Hey all again (I posted for some help yesterday but gladly helped myself eventually).
I am needing some more help.
I'm working on a side-scrolling space shooter. 2 Enemy ships come from the right to the left at random points on the y axis. Firstly, I need them to explode when I shoot them. I have the exact same script I use for my player when it explodes but for some reason it doesnt work. Secondly, I need these ships to fire their weapons. I have their 'bullet' sprites ready but I'm unsure how to go about making them shoot. I think that I'd like them to shoot their bullets when they reach a certain point on the screen. Like, when they get to x position 0, they fire their weapons. I may also need them to fire more then once, as these pre-designated spots on the screen.
Could anybody help me with any of these issues?
Thanks in advance for any help given!
Offline
There are a number of projects around here that do that sort of thing; you could take a look at the scripts in mine. It's just an experiment, not a complete game, but it deals with things like automated shooting, exploding, and multiple shots. If any of it doesn't make sense, post specifics and I'd be happy to help.
Offline
~ First off make sure the bullets are one layer plus behind the "monsters" and at their x and y are the same as the mosters.
~ Next say on the bullet:
Forever
If "x position = "0""
Forever
Change "Bullet" by "10"
If "x position = "240"
Hide
Stop Script
~Then make a script for the bullet
Forever
If "bullet" > 0
Change x by "bullet"
~Then the script for broadcasting a hit
Forever
If "touching (YOU)"
Broadcast
If you need any further help or that^^ is a bit buggy please say...
Last edited by BlackEdge (2009-01-20 17:23:33)
Offline
I have a game alot like what your talking about it's called fighter ace
http://scratch.mit.edu/projects/fireball123/424738
Offline
basicly, when your ships x and y position is < then the target point the broad cast a msg to the bullets to fire. Once they receave the msg, they run a if for if a variable (call it firing?) is 0. if it is, its set to 1, they point to you and a repeat until loop runs that makes them move X steps. The repeat ends when it hits the space ship, or the endge of the screen, and after the loop the firing? var is set back to 0. hope that helped
onedudeuk wrote:
Copy it off someone else's project and give them credit
if you do this, what have you lernt? nothing, your just gonna keep coping. The best way to do it is try figure it out for your self, if you cant ask for HELP not HOW TO DO IT on the forums.
Offline