Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Game Design Theory / Separate Subroutines for Each Course

Author
Message
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 31st Mar 2011 00:11
So I was playing Mario Kart 64 today and realized that although most games use a main loop, in Mario Kart, each course is very different from the other. So do games like that use one main loop for the game, and if so, how, or do games like that have a separate subroutine for each course? Thanks for answers!

DBD79
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 31st Mar 2011 01:48
No need for separate loops since the tracks etc are data not code.

Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 31st Mar 2011 02:00
Yes but in many games the courses have different features. For example, in Mario Kart, some courses have chomps that will cause you to explode if you hit them. Others have boats that move around. I can imagine that you would be able to use if statements that depending on the course data make a certain object do something, but if the data there is zero, there is none....

DBD79
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 31st Mar 2011 04:28
it's not necessary to hard code such things (as in level specific stuff) into the games controller code. Rather the controller uses a state machine styled structure (or via pointer). So different character classes are handled through a common interface.

This allows new character types to plug into the existing infrastructure. So building levels doesn't require re-compiling the game engine every time.


basic styled pseudo code


Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 31st Mar 2011 04:58
That makes enough sense, thanks!

DBD79

Login to post a reply

Server time is: 2025-08-08 16:33:55
Your offset time is: 2025-08-08 16:33:55