Jump to content
  • Advertisement
Sign in to follow this  
Tr??ng Huy C??ng

Mario Game structure

This topic is 984 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i am developing mario game.I have some problems about game structure :
I have a class BaseObject to inhenrit objects . Inside it, i have functions like :
Void Init();
Void Load(Content);
Void Update(Keyboard,GameTime);
Void Draw(Graphic);

COLLI_DIRECT CheckCollision(BaseObject obj);

I controll BaseObject list in class Game .Class Game aslo has 4 functions before (except CheckCollision)

In Game::Update(...) ,I make logic in game ,and check collison, loop BaseObject list call BaseObject::Update(...)

My problem is : I has Mario class extends from BaseObject class , I want to check collision inside Mario::Update() , not inside Game::Update() .But Game keeps object list and i dont want pass more parameters in Mario::Update() because it may break my system.
I have 2 solutions :
_list become static ,and i call anywhere
_create collision event, inside Mario catch this event.
Can anyone solve this problem ??
Thank you for your reading

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!