Author Topic: Teleporting Problems  (Read 1096 times)

Realtime911

  • Wannabe
  • Posts: 44
  • Deep Inside The Darkness,There Is One Truth Folded
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 41.0.2272.101 Chrome 41.0.2272.101
    • View Profile
  • Playstyle: Keyboard
Teleporting Problems
« 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!
The world will once be inverted, from the colorful world into the Monochrome world, the only color is white and black, you'll never see any color, except the 255 sub color they have.

And you'll be keep falling and falling and falling.
Until you reach the end of the world, a place where darkness is.

Sudnep

  • Global Moderator
  • Spike Dodger
  • Posts: 124
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
  • Playstyle: Keyboard
Re: Teleporting Problems
« Reply #1 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)