dale_coop said:
Yes of course...
For example, you could make a script like this:
Code:
;; CHANGE to a "0 - Walkable" special Tile "UnderSecret"
CPX player1_object ;; check if it is the player (not a monster)
BNE finishedChangingTile
ChangeTileAtCollision #$00, underSecret
PlaySound #SFX_GET_COIN
finishedChangingTile:
;;RTS
Save it as "ChangeToWalkableUndesecretTile.asm" in your "TileScripts" folder.
(if you want to use another special tile, just change undersecret to another one).
Then in "Project Settings > Scripts Settings", assign that script to the "Tile Collision XX" of your choice (an unused one) and rename the Tile Type in "Project Labels"
Voilà
Okay, Version 4.11 is bugging out on me....it only lets me make ONE change to the screen and then it won't update the ROM after that. I originally thought it had something to do with this code, but further testing shows the problem up and down the board. I have no idea why. But I should mention that this game started in 4.06 and I moved it to 4.11. Sometimes it works for me and sometimes it doesn't.
It works on 4.06 BUT your line for the Coin sound effect has to be different in that version:
The numbers are in the order they are uploaded; "Coin" happens to be first. The second number establishes the priority (meaning the sound effect must be heard over the music).
The sound plays only the first time you step there, and the original image does not reappear unless you leave the screen, so....that's the good news; we don't have to write arguments for that stuff!
The bad news is that this activates when the first pixel of your player sprite touches the tile, so the coins will vanish right before he gets there. If the walking speed is set high enough, players may not notice. Another fix might be setting the player's bounding box further inward, but that might introduce other problems.
The footprint idea won't really work if the footprints appear ahead of the player. Perhaps it could be rigged to appear when the player steps OFF, or when he's midway through crossing it. I wouldn't know how.
Finally: if you erase the ChangeTile line and just have the tile make a noise, the tile will make that noise every time you step on it. Also, the noise will be longer and more drawn out. Weird.