Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Paki Programmer

Pages: [1] 2 3
1
Graphics / Re: Making a "Paint" Application
« on: September 28, 2012, 03:29:29 pm »
I don't think you saw in my original post that this was just a quick rough draft Nexus :p I'm well aware of all the things you listed and I plan on implementing them in the final version of the program but for now I just made it as simple as I could to see if I could get a semi working program. I do appreciate the input though :)

2
Graphics / Making a "Paint" Application
« on: September 28, 2012, 04:00:22 am »
Ok, so I decided to try and make a MS Paint like application in which you can draw using different brushes, colors, shapes, etc. I just wanted someone to look at my code and tell me if I'm headed in the right direction with this or if I need to approach the "drawing" aspect differently or something. The code is a little bit messy and unorganized because I typed it up quickly just to get a rough idea of where to start. Ill eventually put everything in classes and encapsulate it so worry not ;) Any feed back is appreciated

Here's the code:


#include <SFML/Graphics.hpp>
#include <iostream>
#include <ctime>
#include <list>

float x, y;

int r, g, b;

sf::RenderWindow window(sf::VideoMode(800, 600), "Paint Application");

std::list<sf::CircleShape> circles;
std::list<sf::CircleShape>::iterator iter;

void add(sf::CircleShape shape)
{
        circles.push_back(shape);
}

void update()
{
        iter = circles.begin();

        while (iter != circles.end())
        {
                window.draw(*iter);
                iter++;
        }

        //std::cout << circles.size() << std::endl;
}

int main()
{
        sf::Event ev;

        //srand((unsigned int) time(0));

        while (window.isOpen())
        {
                while (window.pollEvent(ev))
                {
                        switch (ev.type)
                        {
                        case sf::Event::Closed:
                                {
                                        window.close();
                                }
                                break;

                        case sf::Event::KeyPressed:
                                {
                                        switch (ev.key.code)
                                        {
                                        case sf::Keyboard::Escape:
                                                {
                                                        window.close();
                                                }
                                                break;
                                        }
                                }
                                break;
                        }
                }

                if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
                {
                        x = (float) sf::Mouse::getPosition((window)).x;
                        y = (float) sf::Mouse::getPosition(window).y;

                        r = 255;
                        g = 0;
                        b = 255;

                        sf::CircleShape point(2);
                        point.setPosition(x, y);
                        point.setFillColor(sf::Color(r, g, b));
                        add(point);
                }

                if (sf::Mouse::isButtonPressed(sf::Mouse::Right))
                {
                        x = (float) sf::Mouse::getPosition((window)).x;
                        y = (float) sf::Mouse::getPosition(window).y;

                        r = 0;
                        g = 215;
                        b = 255;

                        sf::CircleShape point(2);
                        point.setPosition(x, y);
                        point.setFillColor(sf::Color(r, g, b));
                        add(point);
                }

                if (sf::Mouse::isButtonPressed(sf::Mouse::Middle))
                {
                        x = (float) sf::Mouse::getPosition((window)).x;
                        y = (float) sf::Mouse::getPosition(window).y;

                        r = 0;
                        g = 0;
                        b = 0;

                        sf::CircleShape point(2);
                        point.setPosition(x, y);
                        point.setFillColor(sf::Color(r, g, b));
                        add(point);
                }

                window.clear();
                update();
                window.display();
        }
       
        return 0;
}

 

3
SFML projects / Re: Make a Dev Team?
« on: July 20, 2012, 04:13:37 pm »
I prefer having just one other programmer on my team and MAYBE 2 artists.

4
SFML projects / Re: Make a Dev Team?
« on: July 20, 2012, 04:01:18 pm »
If you had opened your eyes, you'd have seen the third post under yours in the project subforum

My eyes were definitely open, I just don't want to join that group because it's going to get a little too big for my taste.

5
SFML projects / Make a Dev Team?
« on: July 20, 2012, 02:36:17 pm »
I've been feeling rather lonely lately so I though what better way to fix that than to make games with a dev team ;) I want to make a team that can work with me to create some 2D games...starting off a bit simple and then working our way up to something more elaborate. The main goal I suppose would be to just have fun and not take the projects too seriously because people start losing interest and motivation when that happens based on past experiences. Communication and Version Control can be decided on together once a small team has been made.

Pretty much need another programmer to work along side me and maybe 2 artists. If you want more info or are interested in joining just PM me, comment on this post, or email me at sarim.janjua2013@gmail.com

6
Window / Re: Calculating Framerate
« on: June 12, 2012, 05:11:34 pm »
So should the time be in seconds or milliseconds when calculating framerate? And so I guess you would just put "F" in for the parameter in Setframerate() function?

7
Window / Calculating Framerate
« on: June 12, 2012, 03:27:05 am »
Could someone please help me understand how to create a timer in SFML 2.0 RC that keeps track of framerate? I would like my game to run at the same speed on all systems. For instance how would i go about getting about 60 fps? I tried the tutorials and looking around on the web but I'm still kinda stuck. Thanks

8
Graphics / Color Masking in SFML 2.0 RC
« on: May 28, 2012, 05:02:39 pm »
How would you go about using color masks in SFML 2.0? I remember in SFML 1.6 if was something like image.CreateColorMask() or something like that. But now in 2.0 I can't seem to figure out how to do that, especially since sprites are now "textures" and not "images". Any help? Thanks

9
Graphics / Re: 2.0 RC sf::Text bug
« on: May 06, 2012, 04:20:19 pm »
ATI Radeon HD 3200 Graphics 

10
General discussions / Re: sf::Keyboard::isKeyPressed()
« on: May 05, 2012, 01:26:31 am »
maybe make it event based by using ::isKeyReleased() i think? I've never done it before my self because I never had the need but I think that should get you started on the right track. Have the function detect that if the last key released was the space bar, then to set the movement to false. Someone can correct me if I'm wrong

11
Graphics / Re: 2.0 RC sf::Text bug
« on: May 05, 2012, 12:33:16 am »
Ok, so i managed to recreate the bug within a simple little program. The problem seems to be when you set the size of the text past a certain number the blue lines begin to show up. Here's the code:



#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow *window = new sf::RenderWindow(sf::VideoMode(800, 600), "Text Bug");

        sf::Text text;
        text.setCharacterSize(75);
        text.setString("This is a test string");
        text.setPosition(100, 300);

        while (window -> isOpen())
        {
                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                {
                        window -> close();
                }

                window -> clear();
                window -> draw(text);
                window -> display();
        }

        return 0;
}

 

Ran this on Windows 7 64bit, SFML 2.0 RC, and Visual Studio 2010.

Another note that I discovered while attempting to recreate the bug; if you don't make sf::RenderWindow() a pointer like I did in the above code, then the program will crash when you close the window. This is also caused by sf::Text for some reason. 

[attachment deleted by admin]

12
Graphics / Re: 2.0 RC sf::Text bug
« on: May 04, 2012, 12:29:58 pm »
I thought that's all you would need that's why lol ill post the entire code when I get home

13
Graphics / Re: 2.0 RC sf::Text bug
« on: May 04, 2012, 01:02:53 am »
Here is the code:


Code: [Select]

void Game::g_About()
{
sf::Text a_Title;
a_Title.setCharacterSize(75);
a_Title.setString("ABOUT");
a_Title.setPosition((SCREEN_W/4), 50);

sf::Text info;
info.setCharacterSize(M_TEXT_SIZE);
info.setString("This product was made and developed \nby Devil Theory Entertainment");
info.setPosition((SCREEN_W/5), (SCREEN_H/3));

sf::Text copyright;
copyright.setCharacterSize(25);
copyright.setString("Copyright 2012...All rights reserved.");
copyright.setPosition((SCREEN_W/5), 500);

sf::Text esc;
esc.setCharacterSize(20);
esc.setString("ESC - Go back to main menu");
esc.setPosition(0, (SCREEN_H - (esc.getCharacterSize() + 10)));

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{
this -> game_state = mainmenu;
}

this -> window -> clear();
this -> window -> draw(a_Title);
this -> window -> draw(info);
this -> window -> draw(copyright);
this -> window -> draw(esc);
this -> window -> display();
}


14
General discussions / Re: C++/Game Programming Tutoring Classes
« on: May 03, 2012, 08:32:28 pm »
Sorry guys, my mistake. Won't happen again :) The only reason i chose to post on here is because i really can't find any websites that will allow me to post ads for my services. So im stuck posting on forums :( If you can help me find a site that can get views and allow me to post there without a problem that would be great.

15
General discussions / C++/Game Programming Tutoring Classes
« on: May 03, 2012, 05:41:49 pm »
I am willing to teach anyone who is interested C++ and the SFML 2.0 API used to make games. Classes will be held over Skype or GoogleTalk and TeamViewer will be used for real time collaboration and help. Payments will be based on an hourly rate and PayPal will be used for secure transactions. You set how many hours you want me to teach, then pay half the amount to me. Once the lesson is done and the appropriate amount of hours are up, you pay the rest to me. If you are interested please email me at sarim.janjua2013@gmail.com

Payment rate: $10/hour

Students will begin the classes by learning the basics of C++ if they don't already. This includes:

- Understanding of basic theory

- Variables

- Loops

- Conditional Statements

- Functions

- Classes, structures, enumerations, etc.

- Pointers

- Containers/Lists

- Arrays

- More will be added as the classes go in case i feel as though you need to know something else

After a solid foundation has been built with an understanding of C++, students will move onto the next phase and begin to learn game development through the use of the SFML 2.0 API. The ultimate goal of all the lessons combined is to allow the student to make games by themselves with little help if any. Topics for this part of the class that will be taught are:

- Basic game structure

- Rendering sprites

- Player input

- Basic physics - Game audio/music - More will be added and taught as needed

The lesson style that I use to teach involves making students write many small programs that involve concepts that they are currently learning. They will write, test, then rewrite similar programs many times until they know the concepts by heart and are capable of moving on to the next lesson. Each lesson is in essence a small puzzle piece. Once students learn enough concepts, a sort of "test" will be issued which requires students to create a simple game incorporating all of the concepts they have learned thus far.

Many people might say that they can just learn from the internet and go on youtube or search forums. That is true, however you won't get the same experience of working with another person in real time who will talk to you and guide you through the whole process. If you get stuck then I'm there to tell you what you did wrong and what you can do to fix it. You can't get the same experience and learn at the same rate as you would learning from me if you just rely on the internet.

A little bit about me for those who are curious. I am a student and I plan on getting my degree in Computer Science and continue on to become a Software Engineer. These classes that I am offering are not expensive at all, especially considering how much professional classes are. I have experience making games with small indie teams but none were ever finished due to various reasons. I have enough understanding and knowledge about C++ and Game Development to teach those who desire help from me.

An additional note, I live in the United States, EST Time. Please take that into account in case you live somewhere else in the world as timing will be difficult if not thought of before hand.

Pages: [1] 2 3