Creating a Boss that gets Tired after Running

0 favourites
  • 2 posts
From the Asset Store
Endlevel boss, brainwave animation, projectiles, ...
  • Hello, I've been developing a boss for my game and I thought it would be neat to make it like Boom-Boom from Super Mario 3D World where it would run around and chase you, and then get tired and stop. I was able to make it chase the player, but getting it to stop is the challenge, anything I try and do to this code to make the boss stop by either disabling the platform behavior or setting the max speed to 0 does nothing but make the boss run in place and not chase the player at all. Any ideas on what to do?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • have a variable that acts like the boss "stamina" so whenever he moving and is "rested" or has enough "stamina" he can walk, during the walk, he will naturally lose "Stamina" like in real life, you get tired after running/walking etc, especially if you have like 3 metric tons of steel on you.

    so variable called it Stamina.

    Variable call it Rested.

    and we can do something like this pseudo-code:

    if Stamina > 0
    		action > subtract from Stamina 0.01 ( will take around 10-12 seconds to deplete it )
    
    
    If Rested = 1
    		action > enable boss.bulletbehavior 
    		action > boss.set bullet.speedTo Stamina *5
    
    If Stamina <= 0 
    		action > disable.boss.bulletbehavior
    		action > set Rested = 2 (he is not rested now)
    
    

    Now we regenerate the stamina while the Boss is out of stamina.

    If Rested = 2 & 
    If Stamina < 100
    		action > add to Stamina 0.01 (it will take around 10-12 seconds to fully restore stamina to value of 100)
    	triggeronce subevent	action > boss.playanimation "tired"
    

    Now we make the fat Boss run again when stamina is full again

    If Rested = 2 &
    If Stamina >= 100
    		action > set Rested = 1
    
    

    and the stamina and movement of boss + regeneration of stamina, should be in a loop now until you manage to leave him with zero health or something that "keals him"

    hope it makes any sense or helps at all.

    edited the animation setup (needed be on a trigger subevent)

    here is StaminaBasedMovement example based on the above logic, with some extra stuff inside.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)