How Do I Stop Acceleration?
FallingBoxStudios
Freelance Graphic DesignerMember Posts: 822
Hi, I'm creating my game and I have bumped into yet another problem
Basically the game is kinda like a spy sneaker, your character walks automatically and you have to touch the screen to stop walking (to avoid anyone caughting you) but you can only do this when your power fills up (every 5 seconds or more) and I have set the main actor to move using "move" and the only way to stop moving is by holding the screen (as long as you have the power to do it) but I can stop moving by holding the screen as much times as i like even my powers not full, how can I make it that once your power is full, then you can stop walking?
maybe this will help you understand how to solve this,
this is the code I have placed inside the power actor:
Create boolean - named Power - set to true.
Actor receives event - Mouse button - is down + Attribute - game.Power - is true.
Change attribute: game.Power - to false.
timer - for 5 seconds - Change image (to a darker icon to indicate the you power is recharging)
timer: after 5 seconds, change attribute: game.Power - to true.
heres the code I have placed inside the character:
Actor receives event - Mouse button - is up.
move: position - 0. speed - 27.
animate: (animation of character walking).
Actor receives event - mouse button - is down.
animate: (animation of character still)
Hopefully I explained clearly enough, Any replies would be appreciated Thanks.
Hunter
Basically the game is kinda like a spy sneaker, your character walks automatically and you have to touch the screen to stop walking (to avoid anyone caughting you) but you can only do this when your power fills up (every 5 seconds or more) and I have set the main actor to move using "move" and the only way to stop moving is by holding the screen (as long as you have the power to do it) but I can stop moving by holding the screen as much times as i like even my powers not full, how can I make it that once your power is full, then you can stop walking?
maybe this will help you understand how to solve this,
this is the code I have placed inside the power actor:
Create boolean - named Power - set to true.
Actor receives event - Mouse button - is down + Attribute - game.Power - is true.
Change attribute: game.Power - to false.
timer - for 5 seconds - Change image (to a darker icon to indicate the you power is recharging)
timer: after 5 seconds, change attribute: game.Power - to true.
heres the code I have placed inside the character:
Actor receives event - Mouse button - is up.
move: position - 0. speed - 27.
animate: (animation of character walking).
Actor receives event - mouse button - is down.
animate: (animation of character still)
Hopefully I explained clearly enough, Any replies would be appreciated Thanks.
Hunter
Comments
Create a game.timer integer set it to 5
Create a game.move Boolean leave it un ticked (ticked means on)
Create a rule with a timer on actor
Every 1 sec change attribute game.timer to -1 ( 5 second count down)
Then when game.timer =0 set game.move to true
If game.timer is greater or equal to 1 set game.move to false
Hope this is what you are after?
game.Power - to true.
I think I so deserve a free copy when you release it :P