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 - The New Guy

Pages: [1]
1
I very much enjoyed that article, and its 100% correct. If I can't make pong what good am I?
 

Thanks all for the info. Going to dive back in and see where I can get. Going to read through the book that was mentioned.

-Austin

2
" You should really not underestimate platformers though"

This has bit me in the ass more times than I can count. When I first started I made a XNA game that had little Freeza sprites fly across the screen and you (Picollo) had to dodge them. I think that's where I will start, maybe not pong or Super mario level, but just trivial arcade games

-Austin

3
I did quite a bit of that in school and that helped my programming where it is now. I think I struggle more with the actual 2D piece, or things that originate in 2D development(animation,timing, event handling, etc)

I will most definitely check out those resources you mentioned.

-Austin

4
Awesome, I appreciate it.

Would you recommend just running through simple projects(games that already exist) or just diving straight into ideas that I have?

 I guess I also struggle with at what point do I just start going for the project. I am a young developer now(young relative to my coworkers) and I haven't really ever had to do a start to finish project. Just tasks more the most part.

-Austin

5
I was actually running through SFML Game Essentials, which seems more of a reference to me . I think I struggle more with Game concepts and theories more than I do the actual code/logic.

 I will try giving your book a whirl! Ill add another book purchase to my library of code books :D. My e-library is becoming impressive.

Thanks for the insight.

-Austin

6
General / Re: Newbie Time-Based Movement Question
« on: April 20, 2015, 08:06:42 pm »
Thanks for the advice!

I will try this out tonight.

-Austin

7
I find myself struggling to "learn" game development.

I have read and studied many books/tutorials(and when I say many its been two-three years of tutorials books). The only issue I see is I haven't been doing it religiously, will take breaks, etc. I find myself not grasping concepts as well I think I should, making silly mistakes with time-based movement, animation, etc.
I am a intermediate programmer and do so for work. What did/do you do to learn game development apart from just finding a tutorial and book and going with it? Right now I am going through a SFML book and I am going to try to just make pong from scratch once finishing the book. Already I ran into a issue with time based movement and had to go back to examples.

Thanks for any and all input!

-Austin

Edit: Also just to clarify, this isn't a topic on how to develop games, but what strategies,tools, learning techniques did you use to better help your understanding.

8
General / Newbie Time-Based Movement Question
« on: April 17, 2015, 04:53:40 am »
Hey all,

Newbie game development programmer here, trying to figure out why my movement is so choppy. I have implemented the time-base movement that I see from so many examples.

I cant find what I am doing wrong here. Any help would be appreciated!

Code: [Select]
#include <SFML/Graphics.hpp>
#include "AssetManager.h"
#include "Animator.h"
#include <SFML\Audio.hpp>
#include<SFML\System.hpp>
#include <iostream>
#include <SFML\Network.hpp>

using namespace sf;

int main()
{

RenderWindow window(VideoMode(800,600),"Pong");
window.setFramerateLimit(60);
AssetManager manager;



Sprite player1(AssetManager::GetTexture("pong.png"));
Sprite aiPaddle(AssetManager::GetTexture("pong.png"));
Sprite ball(AssetManager::GetTexture("ball.png"));

player1.setPosition(100,300);
int player1Speed =5;
aiPaddle.setPosition(700,300);
int ai1Speed =5;
ball.setPosition(400,300);
float ballSpeed = 100.f;

player1.setOrigin(player1.getTextureRect().width/2,player1.getTextureRect().height/2);
aiPaddle.setOrigin(aiPaddle.getTextureRect().width/2,aiPaddle.getTextureRect().height/2);
ball.setOrigin(ball.getTextureRect().width/2,ball.getTextureRect().height/2);

Clock clock;
Time timeSinceLastUpdate = Time::Zero;
Time TimePerFrame =seconds(1.f/60.f);

while(window.isOpen())
{
Event ev;

Vector2f movement;
timeSinceLastUpdate += clock.restart();



while(timeSinceLastUpdate > TimePerFrame)
{
while(window.pollEvent(ev))
{
switch(ev.type)
{
case Event::EventType::KeyPressed:
if(ev.key.code == Keyboard::Key::Up)
{
movement.y -= -100.f;
}
if(ev.key.code == Keyboard::Key::Down)
{
movement.y -= 100.f;
}

break;
default:
break;
}
}
timeSinceLastUpdate -=TimePerFrame;
player1.move(movement * timeSinceLastUpdate.asSeconds());
ball.move(ballSpeed*timeSinceLastUpdate.asSeconds(),ballSpeed*timeSinceLastUpdate.asSeconds());
if(aiPaddle.getPosition().y < ball.getPosition().y)
{
aiPaddle.move(0,100*timeSinceLastUpdate.asSeconds());
}
if(aiPaddle.getPosition().y > ball.getPosition().y)
{
aiPaddle.move(0,-100*timeSinceLastUpdate.asSeconds());
}
if(aiPaddle.getGlobalBounds().intersects(ball.getGlobalBounds()))
{
ballSpeed *=-1;
}
if(player1.getGlobalBounds().intersects(ball.getGlobalBounds()))
{
ballSpeed *=-1;
}
}
window.clear(Color::White);
window.draw(player1);
window.draw(aiPaddle);
window.draw(ball);
window.display();

}

}

9
DotNet / Re: SFML.Net Event Handling
« on: December 08, 2013, 11:48:22 pm »
Hey guys, I appreciate all the info. Although a lot of what you guys are talking about is way over my head.

namespace TESTSFML2
{
    class Game
    {
        private RenderWindow mWindow;
        public CircleShape mPlayer =  new CircleShape();

        public Game()
        {
            mWindow = new RenderWindow(new VideoMode(640, 480), "SFML Application");
            mWindow.KeyPressed += new EventHandler<KeyEventArgs>(myKeyHandler);
            mPlayer.Radius = 40.0f;
            mPlayer.Position = new Vector2f(400.0f, 100.0f);
            mPlayer.FillColor = Color.Cyan;

        }


        public void Run()
        {
            while (mWindow.IsOpen())
            {
                processEvents();
                update();
                render();
            }
        }

         

        private void myKeyHandler(object sender, KeyEventArgs e)
        {
       
            if (e.Code == Keyboard.Key.Right)
            {
                this.mPlayer.FillColor = Color.Red;
            }

        }

        private void processEvents()
        {
       
            mWindow.DispatchEvents();
           
        }
        private void update()
        {
        }
        private void render()
        {
            mWindow.Clear();
            mWindow.Draw(mPlayer);
            mWindow.Display();
        }

    }
}
 

This is where I am at, So lets say for example and I am trying to test for the user who is pressing the right key, I kind of hit a stopping point on where to go from here, again I realize this is most likely a lack of my knowledge of my understanding of event handling in .NET, any help would be appreciated on how to set up something like just testing for the event of the right key.

Thanks!

Edit 1: I have edited my code, and tried making a little bit of progress.

Edit 2: Well, with the help of a great friend I was able to get something going, I was still running into a problem and noticed I was changing the color to cyan so I wasn't seeing the effect, so I am just going to go work at Taco Bell.  Regardless, if you guys could look over my solution here and see if I am doing everything correctly that would be great! Thanks for the help guys.

10
DotNet / SFML.Net Event Handling
« on: December 08, 2013, 10:38:18 am »
Hey guys, I was wondering if anyone could help me out with Event Handling/Processing with SFML.Net, Maybe direct me to a guide or even just help me out with a post! I can't seem to wrap my head around how to do event handling in SFML.Net, It might be because a lack of knowledge in C#, but it makes perfect sense for me in C++.

void Game::processEvents()
{
    sf::Event event;
    while (mWindow.pollEvent(event))
    {
        if (event.type == sf::Event::Closed)
            mWindow.close();
    }
}

For example, the above example makes perfect sense to me,  You create an event you poll that event and when a event is done by the user, you check the type of the event and if it matches then you perform an action. I can't seem to find out through the resources and SFML.Net API Documentation how to recreate this or go about event handling.

 static void OnClose(object sender, EventArgs e)
        {
            // Close the window when OnClose event is received
            RenderWindow window = (RenderWindow)sender;
            window.Close();
        }

        static void Main()
        {

            // Create the main window
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "SFML window");
            window.Closed += new EventHandler(OnClose);

I have seen this code multiple times, and I assume this is trying to lead me in the right direction, but I can't seem to figure out  how to perform this action for lets say key strokes or anything else beyond this example. Any help would be great!

11
Network / Continually accepting connections using Udp
« on: May 07, 2013, 05:51:26 am »
Hey guys, so I am attempting to work on a Server -> Multiple client based application. Right now I have it set up so I can send each client messages from the server application. The only problem is my program won't continually accept connections. Right now it is set up to accept a connection, I can say a message to that client and then I can connect another client.

I have been working off the CodingMadeEasyTutorials, but I can't seem to figure this one out. Basically I guess what I am asking is how do I continually check for new connections and be able to type from the server at the same time? Do I need to already have to set up some sort of login server?

Any help would be appreciated.

Server Code for Reference

#include<SFML/Graphics.hpp>
#include<SFML/Network.hpp>
#include<string>
#include<iostream>
#include<conio.h>
#include<vector>
 
using namespace std;
 
int main()
{      
  sf::IpAddress ip = sf::IpAddress::getPublicAddress();
     
    sf::UdpSocket socket;
    char connectionType, mode;
    char buffer[2000];
    std::size_t received;
    std::map<unsigned short, sf::IpAddress> computerID;
    std::string text =  "Connected to:"  ;
 
    //std::cout << ip << std::endl;

     socket.bind(2000);
 
    //socket.setBlocking(false);
 
        //char answer = 'b';
        //do
        //{
                //cin >> answer;
        //}while(answer != 'a');
 
    bool done = false;
 
    while(!done)
    {
                sf::IpAddress rIp;
                unsigned short port;
                socket.receive(buffer, sizeof(buffer), received, rIp, port);
                if(received > 0)
                {
                        computerID[port] = rIp;
                        cout << "someone has connected" << endl;
                }
               

            std::getline(cin, text);
            std::map<unsigned short, sf::IpAddress>::iterator tempIterator;
            for(tempIterator = computerID.begin(); tempIterator != computerID.end(); tempIterator++)
                socket.send(text.c_str(), text.length() + 1, tempIterator->second, tempIterator->first);
    }
 
    system(" pause" );
 
    return 0;
}
 

Client Code for Reference
#include<SFML/Graphics.hpp>
#include<SFML/Network.hpp>
#include<iostream>
#include<conio.h>
#include<vector>

using namespace std;
 
int main()
{

        sf::UdpSocket socket;
        std::string text =  "Connected to:"  ;
        char buffer[2000];
    std::size_t received;
    unsigned short port;
 
    std::cout << " Set port number:"  ;
    cin >> port;

        socket.bind(port);

 
       
        std::string sIP;
        std::cout << " Enter server ip: " ;
                cin >> sIP;
        sf::IpAddress sendIP(sIP);
        socket.send(text.c_str(), text.length() + 1, sendIP, 2000);

        bool done = false;
        while(!done)
        {
            sf::IpAddress tempIp;
            unsigned short tempPort;
            socket.receive(buffer, sizeof(buffer), received, tempIp, tempPort);
            if(received > 0)
                std::cout << " Received: "  << buffer << std::endl;
        }
    return 0;
}
 

12
General discussions / Re: SFML 2.0 Tutorials. Loading Textures error
« on: June 22, 2012, 10:05:32 pm »
Appreciate the info. I am at work currently, and I believe I have the image saved in the same directory as the project file. Once I get home I will check over and if I can't get it to work I will bug you guys some more.

13
General / Can't get my project to find my texture(image)
« on: June 22, 2012, 09:58:20 pm »
I am having problems loading images, it can't find the file in VS2010. I have the image saved in the project directory, but its a no go. Any ideas?

14
General discussions / Re: SFML 2.0 Tutorials. Loading Textures error
« on: June 22, 2012, 09:57:03 pm »
Haha will do. I don't actually know 1.6. I started the tuts and then I read on the forums that people just said to start 2.0 since that is where SFML is going.

Fun Fact: The only reason I started a forum account is becase of your sarcastic upfront attitude that made me laugh a lot more than I'd like to admit. Hope you are looking forward to answering my boat load of questions that will come up.

15
General discussions / SFML 2.0 Tutorials. Loading Textures error
« on: June 22, 2012, 09:45:51 pm »
So I have recently started with C++ development and I stumbled upon SFML after playing around with SDL. Regarding, tutorials of SFML 2.0 are there any good ones out there? I am going off of SFML 1.6 and just learning the differences(texture and not image, lots of case sensitive changes, etc). It doesn't seem it would be to hard to convet the 1.6 tuts to 2.0 since the changes are minor for somethings. I may have no idea what I am talking about so proceed to smashing me.


Also I am having problems loading images, it can't find the file in VS2010. I have the file saved in the project directory, but its a no go. Any ideas?

P.S. Sorry for not putting the second part in Help Section.

Pages: [1]