How do I make ?blocks like in mario?

Just started using Construct 2? Post your questions here

Post » Wed Jun 17, 2015 7:43 am

I was just wondering how I could make it so that a power-up comes out of a block, but only if hit from below, similar to a ?block in mario. After trying to figure it out for like, 2 hours, I am just about ready to smash my laptop against a wall:P. Any help on how to fo this would be much appreciated. PS this is a platform game
B
4
Posts: 14
Reputation: 228

Post » Wed Jun 17, 2015 8:09 am

Have you tried searching?

If you search for 'mario block' you'll find lots of useful stuff, including the following post which has a .capx to look at:

https://www.scirra.com/forum/span-class-posthilit-mario-span-style-platform-example-capx_p722040?#p722040
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Wed Jun 17, 2015 8:14 am

Thanks for the help; this file wont open for me for some reason, but I will keep looking
B
4
Posts: 14
Reputation: 228

Post » Thu Jun 18, 2015 6:21 am

First thing is to reliably detect whether you are jumping up into a block or not. Various ways of doing this, but basically check the direction you are moving in (x and y vector) and the relative position of your player and the block on collision. Then spawn the object you want to create.

Your block needs at least two animations for the before and after state (and some kind of instance counter if you want to replicate the Mario multiple coins in a block thing).. You can use a boolean instance to set the block "used up" state or you can use the current animation.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328


Return to Beginner's Questions

Who is online

Users browsing this forum: davidbox and 1 guest