"Beam Struggle" system

Donutdude

Veteran
Veteran
Joined
Jun 29, 2013
Messages
47
Reaction score
3
First Language
English
Primarily Uses
Hi everyone,

     Well on my game I would like to include a sort of struggle mini-game. Lets say an enemy magician casts a mind control spell. I would like a bar to appear that fills up as you press the 'Z' button. But decreases as the enemy magician presses an imaginary space bar.

Something like this:


    If you succeed then the bar gets full and you fend them off. If you fail then the event runs as it would. It would also be nice if one of the player's parameters had an impact on the game. For example, a higher Magic Attack Power would mean your button pushing impacts the bar more.

     I've tried many of the button mashing tutorials and even some different scripts, but none function how I would like this one to. I imagine this is could be accomplished with eventing. But I'm confused on how to do it. Any help would be greatly appreciated!
 

Donutdude

Veteran
Veteran
Joined
Jun 29, 2013
Messages
47
Reaction score
3
First Language
English
Primarily Uses
Does anyone have any suggestions?
 

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
My first instinct is to do a simple recursive method:

Button input; update values; draw new bar -> win/lose: yes? end script; no? call again on next button press.

You'd have the 'opponent' calling the same method, so it would probably be a bit trickier than that, but shouldn't be too bad.

Make it a destructive method and you shouldn't have to worry about stack issues.
 

Donutdude

Veteran
Veteran
Joined
Jun 29, 2013
Messages
47
Reaction score
3
First Language
English
Primarily Uses
My first instinct is to do a simple recursive method:

Button input; update values; draw new bar -> win/lose: yes? end script; no? call again on next button press.

You'd have the 'opponent' calling the same method, so it would probably be a bit trickier than that, but shouldn't be too bad.

Make it a destructive method and you shouldn't have to worry about stack issues.
Are you talking about eventing or scripting? I managed to get the result I wanted through eventing, but I'm always open to more suggestions.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top