Re: Where to begin?

Well, one approach to making multiple levels is to have multiple loops, i.e...

void level1_loop()
{
while (true)
{
playerloop(); //playerloop should handle all the keys pressed and should call any other functions necessary for the player to operate.
}//cl
}//cf
void level2_loop()
{
while (true)
{
playerloop(); //playerloop should handle all the keys pressed and should call any other functions necessary for the player to operate.
}//cl
}//cf

I wouldn't suggest you do that, though. Personally, the way I would do it is by creating a class with a dictionary to store player's objectives and then change them when he or she levels up.
For declaring classes, you really should read the BGT tutorial section on classes (I can't remember if it was 9 or 10, think 10), but in a nutshell, classes are containers that store bits of information. Consider this:

class player
{
int x; //player x
int y; //player y
int health; //player health
//Below is the constructor for the player class. Think of a constructor as the birth of the player. Every time an object is instantiated (created) this function gets called
player(x, y, health)
{
x = x;
y = y;
health = health;
}//cf
}//cc

There's your basic class. How to use it is another matter, though. I unfortunately haven't worked with BGT in a while, so I can not remember how to create the class. Like I said, give the tutorial a read, it can be really helpful.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ty via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : rory-games via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ty via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Jaidon . vinnie_ware via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ty via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Jaidon . vinnie_ware via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : rory-games via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Jaidon . vinnie_ware via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Jaidon . vinnie_ware via Audiogames-reflector

Reply via email to