Rolling my own platformer (teaching a class about c2)

Get help using Construct 2

Post » Sun Jul 20, 2014 1:05 pm

Hi everyone,

So I have a Boston area class on Construct 2 that I'm giving. It's going to be a two hour crash course. I got a request to do a platformer and funny enough, of all the games I've made with C2, I've really not done much with platformers.

Now I know how to do it for the most part with the traditional platformer behaviors and what not, but I wanted to really teach the class how C2 works without relying on premade behaviors. I want to take them through each of the steps of how the platformer is working..

I checked out various tutorials out there, but they all seemed to rely on the platformer behavior. I'm also personally fond of building any game with basic components for greater control, so this is for me as much as the class and for anyone else who wants to control player movement better.

I'm thinking something like a straight Super Mario platformer. I've already made a bit of progress on this. I have a guy jumping, you can see here http://part12studios.com/temp/platformer/ so here is the trouble i'm having:

1. how to slow a guy down? I'm seeing that I can make a guy accelerate with no problem.. but then turning around becomes fight against momentum and also releasing a keypress results in unreliable deceleration

2. how do i max movement. I tried some ways of monitoring velocity, but wasn't finding a good way to regulate velocity when things were going too fast.

3. I used physics, but maybe doing a more controlled platformer is better using some other method to jump and such?

Any advise / tips on this would be really helpful!


Thanks
Caleb
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Sun Jul 20, 2014 2:07 pm

You don't want to rely on behaviours, but you are using the physics engine?
ok..

Would it work to set velocity to zero on key released or something like that?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 20, 2014 3:21 pm

@LittleStain well doing something that drastic would have really sudden stopping.. i'm looking for some easing to stop.

yea it's just so i can show someone new how to construct interesting interactions.. and i think that showing them exactly what is happening will be a useful tool in building a game for them.

also looking at the platform behavior.. they have a Max Speed. I'm wondering how that could be achieved. and max Fall Speed.

here is the capx I have so far https://dl.dropboxusercontent.com/u/699 ... 0test.capx

also like i was saying with point 3.. I'd be very interested in knowing how it could be done without physics, it's just the only way I would know how to do it, but at the same time this is going to be for beginners so I'm not trying to blow their minds with complex math equations.

I'm trying to show how someone could get creative with Construct.. maybe explore double jumping, wall climbing perhaps. etc

Thanks!
Caleb
Last edited by part12studios on Sun Jul 20, 2014 3:38 pm, edited 3 times in total.
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Sun Jul 20, 2014 3:30 pm

Image ImageImage
B
169
S
50
G
174
Posts: 8,327
Reputation: 110,798

Post » Sun Jul 20, 2014 3:36 pm

@newt thanks for the link but my question is specific to Construct 2 and how to achieve a smooth slow-down, not game design in general. :)

If anyone has any pearls of wisdom on this, I'd love to hear your thoughts on it. However I think for times sake, I might go ahead and use the platformer behavior..

I just found it to be useful when I was working on my box flicking game, to not use the drag and drop feature. It wasn't a lot of extra work but it allowed me to have better control over what happens when exactly.. which is the point, but i think the platformer behavior is pretty robust which is nice.
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Sun Jul 20, 2014 3:53 pm

Would this work for you?

Doesn't work while jumping right now, but with som extra conditions this should work for a gradual slowdown, right?
You do not have the required permissions to view the files attached to this post.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 20, 2014 4:39 pm

@littlestain yes that's nice so i see that 0 doesn't stop it, it still slows down gradually which is perfect.. i did some testing before but it seemed like it was much more drastic when I did it.. i must have been doing something different. :)

jumping is weird.. but i'll do some more testing.. the other big thing is how to keep it from getting perpetually faster.. my attempts to throttle it make it very choppy..

Thanks for your help on this subject!
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Post » Sun Jul 20, 2014 4:50 pm

You could set a limit to physics.velocityX
like this:
You do not have the required permissions to view the files attached to this post.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 20, 2014 4:52 pm

If you scroll down that page you'll see a whole section on platforms that includes several studies, and formula on what you are doing.
Image ImageImage
B
169
S
50
G
174
Posts: 8,327
Reputation: 110,798

Post » Sun Jul 20, 2014 6:01 pm

@littlestain so the way you're doing it is every time the velocity hits 750 either way, subtract 100.. then i take it it just keeps going back up to 750, repeat.. that's cool. feels pretty steady from the testing I did

@newt ok cool yea that is nice. thanks! I'm bookmarking this sucker for deeper research for sure. I'd like to better understand the subject for sure. This class won't be that deep yes some real understanding of the math/theory behind solid platformer design would be really good to research before doing a serious project.
B
59
S
9
G
1
Posts: 942
Reputation: 6,553

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 57 guests