How do I change the platform speed in runtime?

0 favourites
  • 9 posts
From the Asset Store
Antisuspend Plugin for Construct 3 prevents the runtime from getting suspended.
  • Hello everyone. just wanna ask how can i change the speed of platform in runtime. Like if a player is collision

    with the object.. how can i change its speed?

    Many thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It depends on the behavior used to make the object move.

    If for example you have an object "Platform" that uses the "Bullet" behavior, and you have a "Player" object.

    Condition. Player - On collision with "Platform"

    Action. Platform - Bullet - Set Bullet Speed to value

    The exact answer depends exactly on how you've set your project, and what behaviors you are using.

    Consider posting your capx to allow us to answer exactly.

  • Hello Kyatric once again thank you for taking time helping me. right now the capx im using is the one coming from

    you from this post

    And im still learning it, as you said i believe i can achieve this one by working on the "collision" and changing the player

    speed in bullet behavior. Have to study it.

    By the way, is it possible in construct 2 that once a player collide on a damage obstacle it will decrease its speed lets

    say for about 5 seconds and then will goes back to its original speed.

    Many thanks! Cheers!

  • Kyatric oops, sorry. i think i am not allowed yet to post a link. what im reffering is on my other post which is about adding

    obstacles. thanks

  • For the 5 seconds question:

    Add an instance variable boolean SpeedAdjust and a timer behaviour to your player:

    on collision

    player set timer "Bumped" for 5 seconds

    player set boolean SpeedAdjust to true

    Player is boolean Speedajust true

    Player set maximum speed

    Player on timer "Bumped"

    player set boolean Speedadjust to false

  • In the autorunner example changing the speed can be achieved by changing the bullet-speed of the block-objects..

    Create a new global variable BlockSpeed and set it to 300

    Player on collison with whatever

    system set variable BlockSpeed to 200

    Block set bullet speed to BlockSpeed

    add a new event

    Block on created

    Block set bullet speed to BlockSpeed

    You should probably also add an event to set the player platform MaxSpeed to BlockSpeed

  • LittleStain whooohh this is gold! I have to learn to apply this timer to autorunner with random blocks. will let you

    know

    Thank you so much!! Cheers!

  • There are many demo tutorial in link below

    https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0

  • Thanks for the link Lordshiva1948 i think i can use those samples in learning construct 2.

    By the way i have a separate question hopefully you can help me.

    How can i add random obstacles with a number on the center of the object? just like creating 5 obstacles with different color.

    e.g obstacle A (triangle) num on the center = 1, color = green

    obstacle B (square) num on the center = 2, color = blue

    obstacle C (circle) num on the center = 3, color = yellow

    obstacle D (rectangle) num on the center = 4, color = red

    obstacle E (oblong) num on the center = 5, color = pink

    Many thanks.

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