|
Post by lukebord1 on Jan 25, 2015 19:49:46 GMT
Hi all,
i'm using the DIG command in my last AGD project.
I'd like to clear temporarily the screen when player loses a life, and show some specific messages until a key is pressed and restart the play.
The "REDRAW" command seemed perfect, but it refreshes the room and all previously DIGged blocks reappear (so its usefulness is lost, it's the same as using the "Restart Screen" event)!
I wonder if i can achieve to leave the screen as it was exactly before the REDRAW...?
|
|
|
Post by andrewvanbeck on Apr 13, 2015 7:52:54 GMT
In v4.6 you can select the adventure (or puzzle) specialisation, this remembers any blocks that you place with the putblock command.
For example, I use this to signify when an enemy or object has already been placed, removed, etc. I use a custom block and putblock it when an enemy has spawned, so the next time it spawns, I check to see if theres a custom block there, and I get rid of the enemy. Same for items - you still have to use the direction or something to signify a new sprite spawn then check for custom blocks, but it gets the job done. With the adventure specialisation it will remember your put blocks.
To work out the column and line for a sprite, I do this:
let line = x let column = y divide line by 8 divide column by 8
You should only need to putblock that first position, rather than a 2x2 square, because a sprite should return the custom check with just 1 block.
|
|
|
Post by andrewvanbeck on Apr 16, 2015 10:43:19 GMT
More...
I've found that using the message system can help clean up the artefacts left by putblock. It appears to me that when you putblock, anything already drawn at that location is included, and it can be very difficult to ensure that everything is out of the way before using putblock.
For example, I have a chest sprite that needs to disappear once it's been opened, and spawns some collectables. So I made event type 7 as clean up type - static sprites that are collected are changed to type 7, which calculates the line and column as above before using putblock and message to clear the space before deciding whether or not to spawn other sprites.
One other thing to note is that if the artefacts are due to the sprite being in place when putblock is used, perhaps you can get away with simply not removing the sprite - it'll be removed on re-entering the screen anyway, and if you leave the sprite in place, it'll act as a mask over the putblock areas and cancel out the artefacts. There's also the chance that switching the sprite to a blank sprite image then removing the blocks on the next loop could work.
It's fiddly, we can really use some clearblock, getblock, blockpaper and blockink commands to help improve the level of control. If AGD goes to 16x16 blocks, maybe things will be much easier then - maybe not for people making traditional MM and JSW style platformers though.
|
|