Hi! I'm pretty new to pulp, although I am a fairly versatile programmer. In my pulp game, I want to save the user's location and room area. However, when I try to create variables to save the user's position and room, it shows the variables as undefined, even though I defined them. Here's my game code:
on load do
restore "varRoomLocation"
restore "varPlayerX"
restore "varPlayerY"
if varRoomLocation==0 then
goto 0,9 in "card"
else
if varRoomLocation=="level-1" then
goto varPlayerX, varPlayerY in "level-1"
elseif varRoomLocation=="level-2" then
goto varPlayerX, varPlayerY in "level-2"
elseif varRoomLocation=="level-3" then
goto varPlayerX, varPlayerY in "level-3"
elseif varRoomLocation=="level-4" then
goto varPlayerX, varPlayerY in "level-4"
elseif varRoomLocation=="level-5" then
goto varPlayerX, varPlayerY in "level-5"
elseif varRoomLocation=="level-6" then
goto varPlayerX, varPlayerY in "level-6"
elseif varRoomLocation=="level-7" then
goto varPlayerX, varPlayerY in "level-7"
elseif varRoomLocation=="level-8" then
goto varPlayerX, varPlayerY in "level-8"
elseif varRoomLocation=="level-9" then
goto varPlayerX, varPlayerY in "level-9"
elseif varRoomLocation=="level-10" then
goto varPlayerX, varPlayerY in "level-10"
elseif varRoomLocation=="level-11" then
goto varPlayerX, varPlayerY in "level-11"
elseif varRoomLocation=="level-12" then
end
end
store "varRoomLocation"
store "varPlayerX"
store "varPlayerY"
end
and my player code:
on update do
if event.dx>0 then
swap "MouseMan1"
elseif event.dx<0 then
swap "MouseMan0"
end
end
on any do
varRoomLocation = event.room
varPlayerX = self.x
varPlayerY = self.y
store "varRoomLocation"
store "varPlayerX"
store "varPlayerY"
end
on exit do
varRoomLocation = event.room
varPlayerX = self.x
varPlayerY = self.y
store "varRoomLocation"
store "varPlayerX"
store "varPlayerY"
end
on enter do
varRoomLocation = event.room
varPlayerX = self.x
varPlayerY = self.y
store "varRoomLocation"
store "varPlayerX"
store "varPlayerY"
end
I think this might have been solved in Help With Player Position Save, but I tried my code on the online sim, the sdk sim, and the actual hardware, so, sorry if I'm being redundant. Any help would be incredibly appreciated