Auto Start movement at load?

Get help using Construct 2

Post » Sun Nov 25, 2012 12:08 am

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?
Posts: 4
Reputation: 808

Post » Sun Nov 25, 2012 1:34 am

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.
Posts: 59
Reputation: 3,719

Post » Sun Nov 25, 2012 6:04 am

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.        Frostcall2012-11-25 06:04:51
Posts: 4
Reputation: 808

Return to How do I....?

Who is online

Users browsing this forum: mindragon73 and 26 guests