Fangames > Programming Questions
Teleporting Problems
(1/1)
Realtime911:
I'm trying to make "after beating the boss, you get teleported to next room", but I don't know what I'm doing wrong
(click to show/hide)
Can someone help me?, any help would be appreciated!
Sudnep:
(You might want to specify for what event the top section of code is for as well as the bottom. I'm assuming the top section is alarm[5] and the bottom section is some step event (begin, normal, or end).)
Well the first thing that I noticed is the
"if hp = 0" statement. That should be "if hp <= 0" in the case of a double frame shot to prevent errors. For the teleporting bug the easiest thing I can think of instead is just creating a warp on the player like this:
(click to show/hide)a=instance_create(player.x,player.y,warp)
a.roomTo = S4_1
There are a lot of things that could be happening but I don't think I can understand that from the code alone. Heres another thing that could work in it's place but it acts basically the same way a warp does:
(click to show/hide)
// playerStart object will spawn player in the room so no need to move player. (might not be possible depending on next room set up and what it is and what it is for)
with(player) { instance_destroy() }
with(bow) { instance_destroy() }
room_goto=S4_1
Last thing I noticed with the code is that in the first section, if the player doesn't exist you try to set player.x and player.y values. That doesn't work unless the player is alive. That might be your error if the player object doesn't exists during transition time.
(click to show/hide) (click to show/hide) (click to show/hide) (click to show/hide)i could just be dumb and missing something obvious as well
Navigation
[0] Message Index
Go to full version