Is there a way to have game engine stop checking for rules
scitunes
Member, Sous Chef Posts: 4,047
I wasn't sure how to ask this. I was messing around today trying to make a doodle jump type game without making a bunch of levels. What I tried to do was have one tall scene that has a ton of platforms but after completing the scene and starting over again (y wrap is on) I have a trigger actor that changes a game integer attribute to indicate which level it is. So on level two all of the platforms change their x position to a random position and some of them are destroyed so that it gets harder. So all of the rules in these platforms are necessary at the beginning of each level, but not any other time. Problem is that the game starts totally wigging out. My guess is that the game engine is constantly checking the game.level integer attribute. So anywho, my question is...
Can I somehow make it so that the game engine stops checking all these rules after the platforms have moved to their new positions?
Wrap all platform rules in a boolean attribute that is only true at the beginning? Or a timer of some sort?
Any ideas?
Can I somehow make it so that the game engine stops checking all these rules after the platforms have moved to their new positions?
Wrap all platform rules in a boolean attribute that is only true at the beginning? Or a timer of some sort?
Any ideas?
Comments
If game.lvl = 1 then change attribute X/Y....
Otherwise, If game.lvl = 2 change attribute X/Y
Otherwise, etc....
Joe says it's more efficient & this way only checks when needed.
That way, the engine only has to check the outermost rule. If that condition returns false, it doesn't check the inner rules, saving you some CPU cycles...
As far as a Doodle Jump type game is concerned, it is only givin the illusion that the scene is huge. The main character pretty much stays put, it's the platforms that are moving down.
I am sure that mulcahy's F is for Falling works like this, as well as Cobra's game jam game, Mr. Blub works like this as well...
It's as if the player is on a conveyor belt.
So imagine you have 2 or 3 platforms hiding at the top of the screen, just out of view. They each have a random delay Timer in them. When the Timer runs out, they start moving down the screen. When they go off the bottom of the screen, they snap back up to the top and the delay timer starts again.