giving the game some 'structure'

Started by
10 comments, last by CesarLopez 12 years, 5 months ago
I haven’t used C# in ages so I can’t say.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement
This is a common mistake I see most new people make, it has to do with the way a lot of people think while program their games. Sounds to me like you used a bottom up approach of programing, when you really need to think in a top down paradigm when making games. How your game sends and receive messages, and triggers events is one of the first things you think about in ANY program, it is not supposed to be treated as an after thought after the game-play is done.

To answer your question, the way to give a game some structure is to know that structure before ever writing a single line of code. to give you an analogy, its like you are building a skyscraper with no blueprints. That being said, there should be an object that checks the player for certain events,for example every time the player get hit, check if the player has died, if true trigger message(you died).


player.HasBeenHit()// run this where you check if a player has been hit

class player
{
Public bool HasBeenHit()
{
(if liveLeft > 0)
{
//after you been hit, if you stil have lives left
//any code you want here
}
else
{
//when lives equal to or less than 0
framework.SendMessage.(PlayerHasDied);
}
}

}


gLhf

This topic is closed to new replies.

Advertisement