Pages: 1
Topic closed
OK. There will be a simple solution to this but I'm tired and getting muddled.
For the moment, I simply want a character to start just 'off screen' on the left, and to then appear and walk across the screen before vanishing 'off screen' on the right. Then, I shall be changing the background and will want the sprite to reappear on the left. In other words - a walking loop where, presumably, x is reset to something like -250. Imagine the idea of a narrator walking from one scene into the next and you'll get the idea,
I can see the edge-detection and bounce control, but that's not want I want.
Thinking about it, it's a shame the edge-detector control can't cope with more options other than 'bounce'.
Offline
You have a couple of options. There is an option under sensing for "Touching Edge" that allows you to do whatever you want when the sprite touches an edge. What you probably really want is to check for the sprite's x position. Something like this:
If x position > 240
set x to -240
Offline
If you look at my version of Semaj's aeroplane game, you'll see that the enemy jets do pretty much exactly what you are looking for.
Offline
Thanks Mayhem. Having just searched out your gallery I realise that I've already tagged a lot of your projects as being worth studying and learning from. There's some really nice work there.
Offline
Thanks - the stuff I submit is often "proof of concept" and so lacks polish, or will never be finished, but I generally try to explain exactly what I was trying to do and how I did it.
Anything I post can be freely canibalised or improved upon - a lot of it is posted specifically with that in mind.
Generally useful stuff for game makers
- shooting routines from:
___ "Semaj798s Aeroplane Game updated" (for shooting straight ahead)
___ "Bow_and_arrow_Updated" (for shooting exactly at the mouse location)
___ "Bow_and_arrow_no_glide" (for shooting in the direction of the mouse location"
- The (crudely) animated archer in "Bow_and_arrow_with_archer"
- perspective routine in Marching Cyberman
Things I am especially pleased with:
- The enemy targeting routine in "Urban Tank Battle v2"
- The method of painting dots in "Pacman experiment v2"
_____(*much* easier than using sprites, anyone planning a pacman of their ownshould really take a look)
- The change of direction of the arrow in "Archery"
- The "view circuit diagram" costume change in Simple Circuit v1
Last edited by Mayhem (2007-06-02 04:19:28)
Offline
Topic closed
Pages: 1