Now, I'm keenly aware that I'm missing the boat by several years here and that people who still use DizzyAGE / post here are all way better than me. But I'd still like to show off :smile: . And who knows, maybe some newcomers can use this stuff. The vets can tell me how rubbish and long-winded it is, but it does work {yolkfolk}:tongue:
MY BRILLIANT FALLING APPLE
(I set an animated crumbling apple in the screen above, as dynamic, id = 4060, anim = stop, collider = call handler, class = hurt. I set two colliders and two reset colliders, 4061 and 4062.)
func CollideObject_4061_1( idx ) //APPLE COLLIDER
{
idx = ObjFind(4060);
if(ObjGet(idx,O_STATUS)==0) //NOT FALLING
{
ObjSet(idx,O_STATUS,1); //FALLING
}
}
func CollideObject_4062_1( idx ) //APPLE RESET COLLIDER
{
idx = ObjFind(4060);
if(ObjGet(idx,O_STATUS)==2) //FALLEN
{
ObjSet(idx,O_ANIM,0); //STATIC
ObjSet(idx,O_CLASS,2); //HURT
ObjSet(idx,O_STATUS,0); //NOT FALLEN
ObjSet(idx,O_Y,790); //SET Y TO ORIGINAL POSITION
ObjSet(idx,O_FRAME,0); //FIRST ANIMATION FRAME
}
}
then:
func UpdateRoom_23_6()
{
idx = ObjFind(4060);
if(ObjGet(idx,O_STATUS)==1) //FALLING
{
y = ObjGet(idx,O_Y);
y+=3; //INCREMENT Y
if(y>913) //HIT THE FLOOR
{
y=913;
ObjSet(idx,O_ANIM,1); //PLAY ANIMATION
ObjSet(idx,O_CLASS,0); //DON'T HURT
ObjSet(idx,O_STATUS,2); //FALLEN
}
ObjSet(idx,O_Y,y);
ObjPresent(idx);
}
}
func UpdateRoom_23_5()
{
idx = ObjFind(4060);
if(ObjGet(idx,O_STATUS)==1)
{
y = ObjGet(idx,O_Y);
y+=3;
if(y>913)
{
y=913;
ObjSet(idx,O_ANIM,1);
ObjSet(idx,O_CLASS,0);
ObjSet(idx,O_STATUS,2);
}
ObjSet(idx,O_Y,y);
ObjPresent(idx);
}
}
MY BRILLIANT CROCODILE
(The default 2-frame tile from FWD, set as dynamic, id = 4065, delay = 7, anim = stop, collider = hard collision, class = none. He is on layer 7, with an invisible block lower down so you don't keep falling if he munches you!)
func UpdateRoom_25_6() //CROC
{
idx=ObjFind(4065);
ObjSet(idx,O_STATUS,ObjGet(idx,O_STATUS)+1); //STATUS INCREMENT
if(ObjGet(idx,O_STATUS)==50) //AT 50..
{
ObjSet(idx,B_ANIM,2); //..REPEAT ANIMATION
ObjSet(idx,O_CLASS,3); //KILL!
ObjSet(idx,O_COLLIDER,1); //YES, DO KILL(?)
}
if(ObjGet(idx,O_STATUS)==150) //AT 150..
{
ObjSet(idx,B_ANIM,0); //STATIC
ObjSet(idx,B_FRAME,0); //FIRST FRAME
ObjSet(idx,O_CLASS,0); //DON'T HURT
ObjSet(idx,O_COLLIDER,2); //BLOCK
ObjSet(idx,O_STATUS,0); //RESET
}
}