Hey y’all,
I’m working on a game inspired by one of my favorite quirky survival horror games, Resident Evil: Gaiden. It’s also my first time experimenting with the pulp game-switcher. In the game, you traverse an overworld, and when you run into monsters, you are thrown into a turn-based-ish battle system where you use the crank to aim and attack the monsters. My vision had been to separate these two gameplay sections using the pulp game-switcher (for space and organizational reasons), but I’m having some trouble figuring out if variables track across the instances. In my code for the overworld, for example, when struck by a monster, I have this:
`if event.px==3 then
if event.py==2 then
enemy_type = "vinemonster"
current_room_type = "outside"
return_room = event.room
enemy_room_x = 2
enemy_room_y = 2
store "current_room_type"
store "enemy_type"
store "player_hp"
store "inventory_slot1"
store "inventory_slot2"
store "inventory_slot3"
store "inventory_slot4"
store "inventory_slot5"
store "inventory_slot6"
store "pistolammocount"
store "flareammocount"
store "hbombcount"
store "syringe_count"
store "return_room"
store "enemy_room_x"
store "enemy_room_y"
store
ignore
shake 1
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
invert
wait 0.1 then
// transition to battle game here
gotoPDX = "gaidenlike-battle"
store "gotoPDX"
store
end
end
end
end
end
end
end
end
end
end
tell 2,2 to
play "vinemonsterholeattack"
end
tell 2,1 to
play "vinemonsterholeattack2"
end
tell 3,2 to
play "vinemonsterholeattack3"
end
end
end
end`
We are successfully swapped into the other game instance, but then in the battle game instance, almost all the “on draw do” code is predicated on reading those values stored in the overworld instance. However, in my testing so far, with debug values and such, the values are not being loaded in, or something else is amiss.
I’m running a simple:
on load do
end
on start do
restore
end
in the battle game instance.
What am I missing? I feel like swapping back and forth between game instances has my brain cooking, so I may just need a gentle reminder on how things work here.