Advertisement
Guest User

Warp Room in YoYo's Engine

a guest
Jan 12th, 2016
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. //This is how i made the warp room in I Wanna Elecspike.
  2. //Something to note about this though, Save files you are currently using are going to break if you use this, probably due to them not having the code in the scripts when you first made those saves? either way, once you create new save files those will be good forever unless you change the scripts again. If you already released your game and this is for an update, uh, fuck idk man.
  3.  
  4. //In the World object's step event under "function keys" at the very end:
  5. if keyboard_check_pressed(ord('Insert_Warp_Key_Here'))
  6. {
  7. if global.warproom = true
  8. {
  9. if instance_exists(objPlayer)
  10. {
  11. with objPlayer
  12. {
  13. instance_destroy();
  14. }
  15. room_goto(Warp_room_goes_here);
  16. }
  17. }
  18. }
  19.  
  20. //In the Create event of a random object in the hub room:
  21. global.warproom = true;
  22.  
  23. //In scrInitializeVariables:
  24. global.warproom = false;
  25.  
  26. //In scrLoadGame
  27. global.warproom = scrReadBytes(f,1);
  28.  
  29. //In scrSaveGame
  30. scrWriteBytes(f,global.warproom,1);
  31.  
  32. //That should be it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement