oldnoob
Member
Hello there,
Platformer question:
I'm having trouble destroying an instance of an object my player is sanding on.The sprite connected to the obj_blockcollapse has 9 frames of animation and the object's create event sets both the image_index and image_speed to 0.
The code in my player's step event is:
I've tried using the collapse ID within the instance_destroy brackets (together with true/false), but I understand this shouldn't matter and it doesn't make a difference anyway.
I'm a little stuck here now so any help much appreciated.
Many thanks.
OldNoob
Platformer question:
I'm having trouble destroying an instance of an object my player is sanding on.The sprite connected to the obj_blockcollapse has 9 frames of animation and the object's create event sets both the image_index and image_speed to 0.
The code in my player's step event is:
PHP:
//check if player is on collapsing block
if place_meeting(x,y+1,obj_blockcollapse){
var collapse=instance_place(x,y+1,obj_blockcollapse);
collapse.image_speed=.2;
if collapse.image_index==8 instance_destroy();
}
else{
obj_blockcollapse.image_speed=0;
}
I'm a little stuck here now so any help much appreciated.
Many thanks.
OldNoob