(06-23-2014, 07:20 PM)puggsoy Wrote: [ -> ]As for suggestions, maybe you could try making the blocks bob up and back down a tiny bit when you hit them, like in Mario. Destructible blocks might be interesting too.
I tried doing this and I failed miserably
In programming there's no such thing as failing, just delaying
What's the issue? Give the relevant code and say what's going wrong (or supply a .gif to show it) and maybe I can help.
make sure you did this:
make this both in the main player and the block this make sure the intances wontget stuck on the ground b'cause the sprites has diferent heights no?
ok so:
in the collision event of the main player(arisa) with the bloick you put this code
i put in images not because imn a bad person.
if just wrote the code here im pretty suer you would just
ctrl+c,ctrl+v
so you can practice
i hope it helps
Not trying to put you down or anything (kudos for helping) but that looks like help on how to hit the block, which Arisa can already do. I think Gors is having problems with getting the blocks to bob up and down, and/or making destructible ones.
Correct me if I'm wrong, though.
(06-27-2014, 10:25 AM)Gors Wrote: [ -> ]I tried doing this and I failed miserably
In that case, it would help us to help you if you tell us what you tried and what think you need help with.
For the bob, I'd just make that a sprite animation. When you hit the bottom of a block, just play the bob animation. Wanna push that further and make objects ontop jump up too? (1) Cache objects ontop. Add them when an object is detected ontop. Remove objects that leave. This keeps the cache up to date (A) On hit, go through all the objects and add or set an initial Y velocity. (2)Alternatively, on hit, you can query for objects ontop at the very moment. [Go to (A)]
For destructible blocks, have the hit block turn invisible or delete it. Then spawn a few particles in it's place (Puff of smoke animation + brick pieces with initial velocity, rotation and is affected by gravity)
This code is from my previous engine so I guess it could help you
Make sure this variable is present on the create event.
Create Event
Step, Begin or End Step Event.
Code:
if ((vspeed > 0) && (y > ystart-4)) {
vspeed = 0;
y = ystart;
ready = 2;
//Add here the bumped block image.
}
if (ready == 1)
vspeed += 0.5;
Use this code WHEN you bump the block. (You can also generate an item on this event.)
Code:
if (ready == 0) {
ready = 1;
vspeed = -4;
}
If you need help with GM, feel free to drop me a PM. I'll try to reply as soon as possible.