|
Post by highrise on Apr 10, 2017 0:22:47 GMT
Hi there
I noticed that when you use lasers, they go straight through sprites, but they don't go through solid walls. I am using a sprite to work as an animated door. Is it possible to stop lasers going through it? I've tried adding and removing invisible solid walls when the door is open or closed, but it causes graphical glitches when the player goes through the door. I also tried 'other' after collision 10 and telling it 'remove' - but that didn't work either.
thanks
|
|
|
Post by andrewvanbeck on Apr 10, 2017 14:03:54 GMT
That is odd, I think there are some issues with the particles specialisation... I mean detecting a collision on type 10 then removing it should work. It's a shame, because lasers are probably drawn a lot quicker than sprites... not always ideal to have to change to a standard sprite and lose that gain.
One option would be to use a solid block door, put a blank sprite on top, and check collision against the player with that... but moving it a little to ensure that it can detect the player. Like move 1 pixel to the right and check, then move 2 pixels left and check, then move 1 pixel right again to put it back where it should be. Fiddly and it means you won't walk through the door, you'll just touch it... but at least lasers will collide with it properly.
Putblock may not work too great without the adventure specialisation, I've never tried it without but it might cause issues - screens are compressed and I'm guessing that it takes some internal handling to update the screens properly - I'd be concerned that the code it needs just isn't available to it.
|
|
|
Post by highrise on Apr 10, 2017 16:00:50 GMT
Thanks - the problem is that what I really wanted was for the door to open and close so that the player can position themselves behind it be used as cover. But it causes glitches.
However, in case anyone is interested, the following will allow you to put a block at the location of a sprite:
divide x by 8 divide y by 8 let line=x let column=y putblock xx (where xx is your block number) multiply x by 8 multiply y by 8
However I have found that when you do this, the engine gets confused with the masking of sprites. I think it must set up some kind of mask at the start of a screen and if you change it, it gets confused because you can walk through something that was originally a solid wall. The result is that when you walk through it, you leave behind a 'copy' of the player sprite on the block. Perhaps it would work if the screen was updated, but that would surely be slow.
|
|
|
Post by alessandro on Apr 11, 2017 20:50:38 GMT
You cannot block lasers with any sprite, they will always pass through.
Drop LASER altogether if you need them to be blocked by a sprite and define them as a new sprite type. This way you can remove them as soon as they hit a sprite.
|
|