|
Post by yeoldegamersteve on Sept 13, 2018 20:32:02 GMT
Sorry for spamming the board with more newbie questions but how do I 'detect' what block the player is touching? I have like an empty box block and a filled box block, when the player walks over the empty blocks I want to replace them with filled blocks.
But I'm unsure how to detect the block as I believe (possibly wrongly) that the collision command is for sprites only?
|
|
|
Post by Doug Bagnall on Sept 13, 2018 21:38:21 GMT
Hi, Yes the collision command is for sprites. You could try objects and use the DETECTOBJ command to find out which OBJ the player has just touched.
|
|
|
Post by yeoldegamersteve on Sept 14, 2018 11:17:20 GMT
I'll see if I can use that, thank you!
Edit: ahh.. no can't get that to work.
When you walk along a platform you colour it in, bit by bit.
|
|
|
Post by manu128k on Sept 22, 2018 0:22:52 GMT
I'm still an AGD newbie myself but my two cents here: You could try with Custom type blocks and a dummy empty sprite. I think you can modify the colour of blocks by changing the attributes of the dummy sprite in the same location. Be warned that if the player or some other sprites pass through it, it may mess their attributes, but if the paintable blocks are supposed to behave like solid wall, you could get away with it. Hope it helps
|
|
|
Post by yeoldegamersteve on Sept 22, 2018 10:49:41 GMT
I'm still an AGD newbie myself but my two cents here: You could try with Custom type blocks and a dummy empty sprite. I think you can modify the colour of blocks by changing the attributes of the dummy sprite in the same location. Be warned that if the player or some other sprites pass through it, it may mess their attributes, but if the paintable blocks are supposed to behave like solid wall, you could get away with it. Hope it helps That would be a good workaround but aren't you limited to 12 sprites on screen at any one time? Sure I read that somewhere.
|
|
|
Post by manu128k on Sept 23, 2018 23:17:07 GMT
Hmm, let's see.. We have two different problems here:
1) Detecting you have stepped on a 'special' block 2) Changing its colour when needed
For 1) you have custom type blocks and the CUSTOM command, so as I see it, you have this covered. I think this point should be easy to do, please say if you have problems, an I'll elaborate on this.
For 2) after some thoughts, I think the easiest way could be to have a different colour block and use putblock over the other one. Never done it but it sounds to me like it could work too
What do you think??
|
|
|
Post by highrise on Sept 27, 2018 12:38:36 GMT
I've done a new video on a simple assembly solution, here: youtu.be/0pGcwYh9hOsHope you find it useful.
|
|