Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Need help for a button mashing minigame

Basically, through events I'm trying to make it so that if you press spacebar a certain number of times within ten seconds, every few button presses a door opens a little bit more. If you make it all the way, the door stays open. If you mess up on a section, the door goes back to shut after cycling backwards through the previous open animations.
I searched for this in the forums but I guess this is the first time this question has been asked. Basically, I need help setting this up. I don't know where to start.
 
I believe I have something that will work, I just have to get some of the details working (like the door opening as you go).
I'll post it once I get it working how you described...or until I can' get it any closer.

==Edit==
Think I've got it!
There may be easier ways but this is how I got it to work.

There's three events involved:

Event 1: The Button
Page 1
Commands
@> Control Timer: Start Up ( _____ time)
@> Control Switch: [minigame] = on

Page 2
Condition = Switch: minigame = on
Commands
@> Conditional Branch: button 'C' is being pressed
    @> Control Variable [bonus] += 1
    @> Conditional Branch: [bonus] > 30  (# the when got over will reset the door)
        @> Control Variable [bonus] = 0
        @>
        : Branch End
    @>
    :Branch End
@>

Event 2: The Door!
(*note: the number of pages will depend on how many images there are of the door as it opens)
Page 1:
Graphic = Closed door

Page 2:
Condition = variable: [bonus] = 7 (or what ever # you want for the door to start opening)
Graphic = next stage of the door opening

Page 3+:
Condition = variable: [bonus] = # you want for the next stage of the door opening
Graphic = next stage of the door opening

Page Last
Condition = 30 (# the door opens fully ~ should equal the # from event1 - page2)
Graphic = door open

Event 3: The Timer
trigger = Parallel Processing
Commands
@> Conditional Branch: Timer 0min 0sec or less
    @> text: Times Up!
    @> control variable: [bonus] = 0
    @> control timer: stop
    @> control switch: [minigame] = off
    @>
    : branch end
@>
(*note: you'll probably have to test whats a good balance between the time the player has so they can't take there time).

=edit=
lol looks like Regimos posted one while i was typing =P
   
 
Clockwise":1wigpnju said:
I believe I have something that will work, I just have to get some of the details working (like the door opening as you go).
I'll post it once I get it working how you described...or until I can' get it any closer.
Thanks for your help, I really appreciate it. If you can't get it exactly like I describe, that's fine. Some parts are not necessary, like the door opening as you go.
 
Well, one way is to use variables and conditional branches. Here's a little code I thought of for you.

Put this on a door event, and set the trigger to Action Button.
Code:
@>Conditional Branch: Variable [0001: Open Door] >= 30
  @>Control Switches: [0001: Door Opened] = ON
  @>Control Switches: [0002: Timer] = OFF
  @>Control Timer: Stop
 : Else
  @>Conditional Branch: Timer 0 min 0 sec or less
    @>Control Timer: Startup (0 min. 10 sec.)
    @>Control Switches: [0002: Timer] = ON
   : Else
    @>Control Variables: [0001: Open Door] += 1
    @>
   : Branch End
  @>
 : Branch End
On the second page of this event, set condition [Switch 1: Door Opened] and put a sprite of the door open, and the door set to through.

Then on another event, parallel process, make the conditions [Switch 2: Timer], and put this:
Code:
@>Conditional Branch: Timer 0 min 0 sec or less
  @>Control Timer: Stop
  @>Set Move Route: [Door]
   :                   :$>Graphic: "170-Door01',0,2,0
  @>Control Switches: [0002: Timer] = OFF

If you want the door's graphic to change as it opens, in the 2nd event put something like
Code:
@>Conditional Branch: Variable [0001: Open Door] == 10
  @>Set Move Route: [Door]
   :                 :$>Turn Left
  @>
 : Branch End
And make it turn right when it's == 20.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top