I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Realtime911 on March 30, 2015, 10:04:07 PM

Title: Teleporting Problems
Post by: Realtime911 on March 30, 2015, 10:04:07 PM
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!
Title: Re: Teleporting Problems
Post by: Sudnep on March 30, 2015, 10:35:50 PM
(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)

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)

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)