Custom Movement - Acceleration number

Just started using Construct 2? Post your questions here

Post » Sun Apr 24, 2016 10:43 pm

My game consists of a cat jumping to platform to platform. The platforms shift to the left as the cat jumps, to give the illusion of a right scrolling level.

For one of the platforms, the acceleration is -12225. What does this number mean exactly? I didn't see it in the manual.

Thanks.
B
13
S
4
G
1
Posts: 54
Reputation: 1,440

Post » Tue Apr 26, 2016 4:00 am

Acceleration is the change in speed.

Is it causing a problem?
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Tue Apr 26, 2016 8:08 am

I was just wondering what the 'math' is to the number when it comes to the play screen. The platforms in my game move left giving the illusion the character is moving right. I'm having a hard time trying to get the character to land directly in the middle of the platforms each time, plus trying to figure out the spacing between the platforms. There's so many slight changes I need to make to the acceleration of the platform that for all these levels that I'm making, I would be wasting a lot of time adjusting the number by small increments. So, I just wanted to know what the math would be to easily figure out speed and distances using the sprite origins and such.
B
13
S
4
G
1
Posts: 54
Reputation: 1,440

Post » Tue Apr 26, 2016 9:43 pm

Do you need custom movement behaviors?

Is the player supposed jump fixed distances and always land on the center of a platform, or are they free to move around like Mario games?

Are your platforms all the same length and spacing or all different?

I'm assuming the platforms are dynamically generated and not placed ahead of time, else you can just use scrollto and keep your player centered on viewport.

A capx or screenshot would help to visualize your situation.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Tue Apr 26, 2016 10:07 pm

The platforms shift to the left as the cat jumps, to give the illusion of a right scrolling level.

I don't get why you do this instead of having a fixed level and a moving player? Wouldn't it be easier to design the levels if they are fixed? Plus, it seems less optimized, as the game constantly needs to update the position of each platform.
B
6
S
2
G
1
Posts: 4
Reputation: 913

Post » Wed Apr 27, 2016 5:16 am

It's a platform jumping came where the user has to hit the correct number that corresponds to the platform.

Yes, all the platforms are the same size and spacing.
Edit to add: ALL the platforms are spaced equally. Some of them will be invisible with solid disabled.

As the platforms shift offscreen on the left side, they hit another hidden sprite which sends them back to the original point to be looped through the level again.

I was just wondering how the acceleration number works so I can easily implement it. My coding is very young, so to speak, so there's no fancy tricks or anything. All straight forward. The way i have it is the cat jumps and the platforms accelerate at -12500. That number is very strange to me since the screen is only 400px wide. What does the 12500 mean? 12500 pixels?
B
13
S
4
G
1
Posts: 54
Reputation: 1,440

Post » Wed Apr 27, 2016 5:59 am

It's 12500 pixels/second^2. You must be setting a max speed to the behavior otherwise the platforms would keep going faster and faster very quickly.
B
94
S
33
G
113
Posts: 5,356
Reputation: 73,273


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests