Basically i'm making a side-screen scroller ship game thing - if you remember my other game Fantasy World, i'm making the sequel.
And I need it to be able to fire a laser beam. So user holds space bar and a beam fires out. I dont want it to just fire an object - I want it like those beams you see in DBZ (not that I watch it or anything) or something like that..
I've tried alsorts - but I guess i'm still not good enough to know how to do it, or if its even possible in TGF.
If you have any ideas, please share them with me !
TGF has fastloop, doesn't it? Yeah, just have two objects, one the front of the fireball (if you want your laser to be lead by a fireball like those in DBZ), and the other a round circular thing that fades from say, white to dark blue. I'll call them Fireball and Lazer respectively.
Number of Fireball > 0
- start loop 0 for 7 loops
Loop trigger #0
- Fireball: X position = X(Fireball) + 1
- Create Laser at (0,0) from Fireball
Laser animation stopped is over
- Destroy Laser
Change the number of loops for the fireball to move faster accross the screen, and make the Laser animation longer for a longer trail. If you want it to be more of a normal laser rather than a dbz Ki ball, make the fireball look just like the Laser's first frame.
You can then test if Fireball collides with an enemy and destroy it, or if you want a more Gradius-style laser, use a much faster loop (say, 20ish loops per action), and test whether enemies are colliding with Laser instead (but don't destroy Laser, use a flag instead to make each one only hit once).
Ok I've tried it - but it isnt quite how I wanted it.
I want it so that when I hold space bar, it still keeps firing the laser up to a certain distance (and when the ship moves, the laser moves with it)
Its hard to explain what I want, and if it's possible in TGF.
I already knew about the second laser theory thing - but I prefer the other.
I tried doing what you said - but now its really messed up.
I have uploaded the .gam file to show you - maybe you could fix it (if you dont mind/have the time)
Delete all the laser and fireball objects on the playfield before you run, since there's only ever supposed to be one on-screen at the time (and you'll probbaly hit the object limit if it's trying to draw four lasers at once).