GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Basic Shooting game with unique Death

Hello there, I was wondering if anyone knows how to gradually add a constraint on the main actor making him walk slower and slower until he is unable to move. Then have an option to kill yourself to restart the scene.

The effect I want is when the zombie enemies are colliding with the actor, he must shoot them off, but if there is too many over a certain period of time he will slow down and eventually be unable to shoot and move; then he will have an option appear on the screen that you can press to kill the actor, and start the level over.

Would anyone have an idea how to go about this technique?

Comments

  • mrpacogpmrpacogp Posts: 400Member
    Increasing Density or Friction i have similar results from my game.
  • SocksSocks London, UK.Posts: 12,822Member
    edited February 2013
    Every time a zombie collides with the actor reduce his speed by a certain amount.

    Like this:

    When actor collides with zombie change an attribute called ['Speed!!!'] to ['Speed!!!' -10]

    So if his initial speed is, for example, 200 - and if he keeps colliding with zombies this 'Speed!!!' attribute will go:

    200
    190
    180
    170
    160
    . . . . etc etc


    So you can use this speed attribute to control his overall speed.
  • SocksSocks London, UK.Posts: 12,822Member
    edited February 2013
    Here, I made you a quick demo:

    Use the keys to avoid the 'zombies' (cough . . cough . . 'squares)'.

    http://www.mediafire.com/?ngba4xy3t65ru23

    You start with a speed of 300, every time you collide that goes down by 10, it's quite funny you do start to feel exhausted/weaker when your speed drops.
  • yomamababyyomamababy Posts: 8Member
    Sweet, thank you.
    I did not see an option for "speed" but I found density and added a density attribute on the actor itself and set it to real and at 200. I also put the Rule when actor collides with Zombie do Change attribute of self.physics.density to self.physics.density-10, and for some reason it didn't change the movement speed of the character any.
  • SocksSocks London, UK.Posts: 12,822Member

    I did not see an option for "speed" but I found density and added a density attribute on the actor itself and set it to real and at 200.

    You can add these 'options' (attributes) yourself, there isn't one called speed, you just make up a new attribute and call it what you want - and then apply it to what you want.

    I also put the Rule when actor collides with Zombie do Change attribute of self.physics.density to self.physics.density-10, and for some reason it didn't change the movement speed of the character any.

    Yeah, that's right, density is not what you are after here.

    Q: how are you controlling your main actor - I mean: what are you using ? Move ? Move to ? Accelerate ? . . . etc etc
  • yomamababyyomamababy Posts: 8Member
    Great! Many thanks, that slowed my character down to a stop which was exactly what I wanted. I did so by making a speed attribute in the Game section and added the speed attribute for each direction. I am controlling my character by using the Move block and when a key is pressed. I have however, one last question regarding this. How would I reset him back to normal when I reset the scene? It works fine if I reset the game.
  • frank067frank067 Posts: 56Member
    I flip the scene and made the zombies slow down but when I destroy them and respawn they don't reset, how can I reset the speed to the actors?
This discussion has been closed.