M
monkeyfrommars
Guest
Hello! I'm pretty new to programming, but I have this assignment that requires me to create a game from scratch. It's a top-down, pixel rpg. Anyways I have this warp block that warps the player to another room and then destroys itself when it collides with the player. Before, I had the command "instance_destroy(self);" at the end of the collide with player event, but that didnt work so i tried this:
Create Event:
var targetRoom, targetX, targetY, newmsg;
Collide with player event:
instance_create_depth(0, 0, -9999, otransition);
room_goto (targetRoom);
oplayer.x = targetX;
oplayer.y = targetY;
objective = newmsg;
marker = true;
Step Event:
if (marker = true)
{
instance_destroy(owarp2);
}
It still wont destroy itself though, this has happened a few times and I dont understand how I fixed the other ones. I'm on a tremendous time crunch so I havent had time to peruse the manual im sorry i know i should have... again im fairly new to programming, but id like to think that i have a natural talent for it (evidently not, i suppose). Sorry for the long thread i tend to ramble a lot...
EDIT:
Whoops sorry I forgot to add the creation code for the object.
Creation Code:
marker = false;
targetRoom = inschool;
targetX = 1215;
targetY = 720;
newmsg = "Wait for Mom at the front";
Create Event:
var targetRoom, targetX, targetY, newmsg;
Collide with player event:
instance_create_depth(0, 0, -9999, otransition);
room_goto (targetRoom);
oplayer.x = targetX;
oplayer.y = targetY;
objective = newmsg;
marker = true;
Step Event:
if (marker = true)
{
instance_destroy(owarp2);
}
It still wont destroy itself though, this has happened a few times and I dont understand how I fixed the other ones. I'm on a tremendous time crunch so I havent had time to peruse the manual im sorry i know i should have... again im fairly new to programming, but id like to think that i have a natural talent for it (evidently not, i suppose). Sorry for the long thread i tend to ramble a lot...
EDIT:
Whoops sorry I forgot to add the creation code for the object.
Creation Code:
marker = false;
targetRoom = inschool;
targetX = 1215;
targetY = 720;
newmsg = "Wait for Mom at the front";
Last edited by a moderator: