Game Development Community

How would you make the levels change after you complete one... in game without using a button?

by Christian Sanders · in Torque Game Builder · 06/04/2009 (11:46 am) · 4 replies

I'm just trying to figure out how to make the levels change after you complete one, as in level progression from 1-1 to 1-2, etc.
Can anyone help me with this, I know this has a simple solution I just don't know how to do it?
Also, is there any way to "pull" random items from a GUI Control in game: i.e. place mouse over a box in upper right hand corner of screen click and then drag anywhere on screen and produce a random item?

Thanks in advance,
Christian

#1
06/04/2009 (1:01 pm)
Level progression is just a condition to check for. So if you have a score that needs to be a certain value, for example, then whenever that score changes, the function that updates it would check for that value, and if true, would kick off the level change.

For clicking and dragging, I haven't done it, but how I would approach it would be to figure out the mouse coordinates of where you're mouseUp message occurs, and then create an item at those coordinates. How you create said item depends on what you want to create (object, GUI object, etc). But the overall function of the mouseUp function calling a createNewThingy() would be the same. Just make sure you pass the coords on to the created object so it is where you drop it.

Hope that helps.
#2
06/04/2009 (2:04 pm)
Thanks Ted! As for the clicking and dragging, the item(s) would be pre-made sprites that interact with the main character, such as a baseball bat that would be held by the mouse/finger to beat the main character. I have the items setup and ready and I think that I'm gonna assign numbers to each of them so that I could use a random number generator to generate the item that corresponds to the number drawn by the RNG... or would something like that work at all?
#3
06/04/2009 (3:40 pm)
It will work technically. No idea if it would be fun to play ;)
#4
06/05/2009 (11:55 am)
It would, of course, have more than just a baseball bat for the beating of the character ;)