Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualPragmaOnce

Posted 06 April 2013 - 02:13 PM

Thank you for clearing that up for me Jtippets. I really appreciate all the advice you guys have given me. It seems I will be doing a lot more research concerning event systems and behaviors the next few days.

 

All of the examples have been used in terms of a reasonably complex game where the game needs to be broken in pieces to fit into our heads. But what about small games like pong or snake. Surely the event based system is complete overkill. Would it be better in these situations to have a universal Game class that handles all the specifics? For example if the ball hits the paddle in pong you would have this in Game.update():

 

 

if world.collide(paddle,ball)
{
  soundManager.playSound(ball_hit);
  ball.physics.bounce();
}
 

 

 

I can see this will become a huge problem if you don't know the exact boundaries, scope and specifics of the game.  Are there any alternative methods that could be used when dealing with smaller games?


#1PragmaOnce

Posted 06 April 2013 - 02:12 PM

Thank you for clearing that up for me Jtippets. I really appreciate all the advice you guys have given me. It seems I will be doing a lot more research concerning event systems and behaviors the next few days.

 

All of the examples have been used in terms of a reasonably complex game where the game needs to be broken in pieces to fit into our heads. But what about small games like pong or snake. Surely the event based system is complete overkill. Would it be better in these situations to have a universal Game class that handles all the specifics? For example if the ball hits the paddle in pong you would have this in Game.update():

 


if world.collide(paddle,ball)
{
soundManager.playSound(ball_hit);
ball.physics.bounce();
}

 

I can see this will become a huge problem if you don't know the exact boundaries, scope and specifics of the game.  Are there any alternative methods that could be used when dealing with smaller games?


PARTNERS