Auto Start movement at load?

0 favourites
  • 3 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • I can't seem to figure this out and I'm sure it's simple. I've searched the forums but my searching is in vain.

    Here is what I'm looking to do:

    Start my character moving from left to right, across the screen at a set speed (70 in this case) with the gravity and other attributes that go with a platform behavior. When it hits a solid, I'm going to have it start the other direction. The user does not control the character, they will be interacting with other objects on the screen to influence the movement of the character.

    At first, I was all 'Bullet'! because I can start it in 1 direction then it bounces off the walls but the bullet has flaws. It either bounces constantly on the ground as it moves forward or falls through solids :(

    Then I was like 'Platform'! and I told it to simulate the Right key at every tick and block input from the user, but then the character does not turn when he hits a solid wall.

    I tried combining the two but it just falls off the map.

    What am I missing?

  • Use Platform behavior and try something like this;

    This assumes you have a side-view character facing right by default.

    a) Simulate press left if Player is mirrored

    b) Simulate press right if Player is not mirrored

    c) When the Player hits a wall switch between mirrored and not mirrored.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • <img src="http://www.scirra.com/forum/smileys/smiley32.gif" border="0" />

    Thanks for the advice. I tried a few ways of doing it and this is the one that worked; I created an instance var bool, called 'flip' starting at false. I then did this:

    1) System > every tick >

    > 2 char > is flip > char > Simulate Platform pressing left

                          > char > Set Mirrored

    > 3 char > X is flip > char > Simulate Platform pressing Right

                          > char > Set Not Mirrored

    4) char > Platform On stopped > char > Toggle flip

    It now does exactly what I wanted! Of course, I'll need to add in the code to block input but above are the parts that count.

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