whenever the user presses A, an event inside the "player" script called "comfirm" is run
if you go over to the left and click on Scripts, use to top left dropdown to access the script named player. (some places in pulp, if you change the name of the player tile, it will change this script's name to match and other places, it will still say "player" so watch out for that.
in the script, of there is a section that starts with on confirm do this is where you want to be working. if there isn't, just go down to the bottom of whatever is (or isn't) there and type that in, press enter a couple of times (don't let it autocorrect "do" to be "dock") and if it doesn't do it for you, add a line that says end below.
between the on confirm do and its matching end, you'll need to add some code to do what you want. something like this
on confirm do
new_grabbbed_tile = name event.px,event.py
if grabbed_tile!=0 then
tell event.px,event.py to
swap grabbed_tile
end
end
grabbed_tile = new_grabbed_tile
end
this will let the user swap any tile at any time so you may want to put some conditions in there for when this is allowed
basically, anytime you say a = name x,y it will take the name of the tile at position x,y on the screen and save it to the a variant
in the case of what I wrote, it takes the name of the tile at event.px,event.py and saves it to a variable named new_grabbed_tile. event.px and event.py are special values that will always match the player's location. new_grabbed_tile is just a made up variable name so we can have a way to hold on to what tile is being selected. you could have picked any variable name.
I suppose I should say what this does exactly
as the user pressed buttons on the dpad, they will move the player around (this is just the default behavior of a Pulp game) and when they press A, this script will run and will
save the name of the tile the player is on
if there was a tile grabbed before this, change the tile they are on to whatever was last saved
make the new saved tile name the saved one for next time
I hope that is what you're asking for or is close enough
if you want to have formatted code in a reply here, you have to put three tick marks above and below it. tick marks as in the backwards looking apostrophe, it is usually the key above tab and to the left of 1 on your keyboard. This guy `
So you put three of them, press enter, paste code, press enter, put three more ticks and it will keep your indents and make everything spaced like code