I have a sprite and I can move it around with the arrow keys and now I want it to start shooting. I know its possible to do as I want it to, because I have at least seen 360 shooting.
I want to be ale to move my ship around the screen and using the mouse cursor shoot in 360* dirrections at enemy ships, I don't want the ship to move really fast, just 2x speed or -2 times which it is now doing speed wise. I am just a little stumped on how to do this, I have looked at some other code and am trying.
I have made a little cross hair spite and its on the screen now, but I can't control it or anything, working on it.
If you could give me a few pointers that would be cool, just new to this But its fun so far
Thanks.
Last edited by PaulMathews (2007-08-25 21:52:09)
Offline
crosshair:
when flag clicked
forever
*go to x: mouse x y: mouse y
now when you do the green flag the crosshair will always go to the mouse
sorry if that isnt what you wanted
Offline
Your forever loop should have a small delay in it, to keep the loop from causing scheduling problems for other parts of the code. Updating a cursor location 20 times a second is usually plenty.
when greenflag
forever
goto x: mouse x y: mouse y
wait 0.05 seconds
Offline
It sounds like you are doing an asteroids game. Maybe my demo project has some solutions you could use. http://scratch.mit.edu/projects/dinther/34522
Offline