Hello all,
I'm kind of new to scratch so apologies for any stupid questions.
I am trying to create some kind of tank game and have mastered a very basic movement script of moving the sprite left and right. I wanted to add a bit of complexity in terms of controlling the turret and am having difficulty.
Ideally when pressing the up button I want just the turret to aim up and when I push the down button for it to aim down. As this motion would involve just the turret and not the tank as a whole I assume it would have to be a separate sprite?
I'm having two difficulties:
1) Linking the sprites together so that they appear as one. This is especially difficult when changing direction as the two become out of sync as the turret would have to move to a different point rather than just changing directions.
2) Movement of turret around a fixed point. the closest I can find is point sprite at mouse pointer however it fixes the middle of the sprite rather than at one end like a tank turret. Is there any way to set the point that the sprite moves around?
I hope some of this makes sense, basically I just want to create an aim able turret that moves with the tank. Any ideas?
Many thanks,
Offline
This sounds like an interesting game! Anyway, here are my ideas for solving your difficulties:
1). If you want to, you could use multiple costumes, or you could have a sensor and have the tank and turret both go to their respective parts of the sensor. Both will experience lag, so it will look smother.
2). Yes, this is possible. In the paint editor, you'll see a button with a plus on it. Just click it to change the sprite's center.
I hope that this helps! And good luck with your game!
Last edited by ErnieParke (2012-10-09 20:22:59)
Offline