Primkinkajou
New member
Hey, I'm new here. Nice to meet all of you. Anyways, I'm having a slight problem when starting to create scripts. In the scrolling platformer module I was trying to make a simple script so that when I pressed the start button I would warp to my first level. I got it to work by stealing code from the "warp tile" (which took forever btw), but my player didn't spawn in where I placed him in the overworld editor. At this point my code looked like this:
So i figured that maybe I needed to change the gamestate to get it to spawn. I altered my code until it appeared something like this:
But that still didn't do it. So i turned to the fat list of macros on the side of the "defined scripts" menu. I found the "CreateObject" macro and browsed this site for a way to use it until I came up with this:
This spawns my player, but spawns him offscreen so I get warped to an unintended area. I tried putting values into newX and newY such as #$90 and #$d0 becuase I wanted it on the tile (9, 13) but to no avail.
Any help is appreciated on this problem, but I like to teach a man to fish rather than give him a fish, so if you have resources on how I could look at to learn how to use this codebase and documentation on the various macros and constants used, I would love to see them so maybe in the future I can fix my own problems. Until then I'm turning to you guys, and am eternally grateful for your support.
Code:
GoToScreen #$00, #$01, #$03
RTS
Code:
LDA #$00
STA newGameState
GoToScreen #$00, #$01, #$03
RTS
Code:
LDA #$00
STA newGameState
GoToScreen #$00, #$01, #$03
LDA playerToSpawn
CreateObject newX, newY, playerToSpawn, #$00, currentNametable
RTS
Any help is appreciated on this problem, but I like to teach a man to fish rather than give him a fish, so if you have resources on how I could look at to learn how to use this codebase and documentation on the various macros and constants used, I would love to see them so maybe in the future I can fix my own problems. Until then I'm turning to you guys, and am eternally grateful for your support.