Okay.. so it looks like you two are using my movement engine or variations of it... that makes things easier for me.
Only problem is that code wasn't designed with regular wall-pushing in mind. That might make it imperative to have a "wall" parent for all types of wall or block solids, pushable or not.
Would you guys prefer the LTTP way where Link starts pushing about half a second after you run into the wall, or instantly like the GB games?
dlbrooks, I'll have to look through your shield code for a minute first, but please tell me, do you want to disable pushing while Link is using a shield?
I'll have to get back to this later for the pushing code.. sorry but I woke up really late today and still have a bunch of things to do.
But to get you started, we can set up some variables in the block objects that will be useful for later.
//Create:
moving=0
movingdir=0
movesl=0
movesr=0
movesu=0
movesd=0
count=0
//Alarm 0:
count=0
The first two will always start at 0 and only change when they're moving. The next four "moves" variables can be changed for each different copy of this object; they will be the number of times this block can be moved in each direction.
Now for Parents: Make two new invisible objects, called objWall and objPushblock.
For every variation of pushable block that you make, set its Parent to objPushblock.
For every type of "wall" solid you have, (ie. invisible object you place in the maps to stop Link from walking there), set its Parent to objWall. OR, if you only have 1 type (the basic 16x16), that can be the objWall itself and you won't have to give it a Parent. It's just that my game uses different sizes of invisible solids, such 64x16, so I can fill up the level with a minimal number of instances. But, either way works.
Now, set objPushblock's Parent to objWall.
So, every type of pushable block will count as an objPushblock, which makes it easier to detect in code. Plus, every invisible solid
including pushable blocks will count as an objWall, which will be used to tell Link to use the pushing animation when he runs into it.
More code to follow...