Die falling into a hole, being bound to layout...

Get help using Construct 2

Post » Wed Sep 19, 2012 5:17 pm

Well... basically, i want to have a sprite bound to layout, but still be able to fall into a hole and die...

I tried making him NOT bound to layout, and adding invisible blocks at the sides of the layout, but the character wall jumps, and i don't want to wall jump from the edge of nothing

i also tried to make him "bound to layout" and adding an invisible object at the bottom of the layout that kills him (as in the capx), but it activates the death animation... i dont want it to die before vanishing into the bottom.

is there a way to make a sprite bound to layout only horizontally? or another way of doing it?   

hope you guys understand, my english isn't very good...

here is the game, and here is the capx if u guys want to download and check, or something...

keep in mind that i only have the free version, and im very new to construct 2, still learning... AND it's a very early development, so the sounds are placeholders and the gameplay might not be good yet

thx in advance!Lobo932012-09-19 18:02:21
B
7
S
2
G
1
Posts: 32
Reputation: 1,089

Post » Wed Sep 19, 2012 9:05 pm

I have a lot to do today, but I made a few quick changes to your project to show you one way to handle the issues you mention. There are probably many other ways--probably even better ways, but this should help you move on.

1) Remove bound to layout behavior from player.
2) Moved the player's start position up in the sky just because I can. ;-).
3) Placed a condition that if the player's X is < 0 or player's X > Layoutwidth, set the player back to 0 or LayoutWidth so he can't go past the edges of the layout. (The yellow walls don't really do anything. They could be deleted. The ceiling does still keep player from going any higher than the ceiling.
3) Create a condition Player is outside layout and then test several sub conditions, like if player hits hole, dies, or if player falls in death trap, loses a life, but can jump out of it. You don't have to nest the two conditions below the player is outside layout condition. I just wanted to show a way you could get more control. For example, if the player hits the death trap but is still inside the layout, no harm. Only if the player falls down deep enough to be outside the layout does he lose a life.

Notice one of the advantages of using a sprite instead of tiled background for your hole would be that you can create a custom collision polygon like I did for the death trap. Also I'm not sure how efficient tiled backgrounds are, so you should only use them where you need to, like the repeating grass and ground.

Oh, yeah! Almost forgot the link. Lobo_changes.capx

PS Just wanted to say I like your game a lot and look forward to seeing more.
kittiewan2012-09-19 21:08:00
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Wed Sep 19, 2012 10:02 pm

Omg, that's exactly what i wanted, thank you so much, Kim!
Maybe I'm still thinking in the box too much
But i promise i'll get better, and hopefully i'll have a good game to post soon!
Certainly not as great as the ideas i have in mind, 'cause i'm nearly hitting my 100 event limit, but i'll do my best
B
7
S
2
G
1
Posts: 32
Reputation: 1,089

Post » Wed Sep 19, 2012 10:25 pm

@Lobo93 - I can't believe I forgot to mention the easiest way of all to fix the problem: Make your layout taller and then move everything so that the ground isn't at the very bottom of the layout. Then you can still use bound to layout and the sides will work the way they do now, but the bottom of the layout will come after the hole collision.

EDIT: I just checked your original project, and it is at 39 events so far. (The number of events is in the status bar at the bottom of C2).

You can do a lot with a 100 event limit. Keep in mind you can have as many actions on one event as you want. It is only the number of events that makes a difference. So you can combine some things in clever ways...

For example, if you have a zombie and a skeleton as enemies, combine them in an enemy sprite with different animations and they'll share many events. Look for other ways to do that, like combine the player and dead player into one sprite--or perhaps better in your case, the dead skeleton and dead player into one sprite with different animations.

You can have many different kinds of pickups using the same penny sprite. Add some instance variables to help customize them...

You could have many different traps using something like the death trap. Each animation--and each frame of each animation can have its own collision poly, so that really opens up what they can be like.

However, despite all of the possibilities of what can be done with the free version, I'll never regret the money I spent on C2. It was well worth it.
kittiewan2012-09-19 22:30:58
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Wed Sep 19, 2012 10:51 pm

LOL that'd work too!
I think i'll spend some time re-checking all events in my project till now to maximize efficiency.
And i'm really looking forward to buy the standard C2, it seems really worth it for the power it has, yet being so easy to use
B
7
S
2
G
1
Posts: 32
Reputation: 1,089


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests