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.
Loop trigger #0
+Fireball value A < (the distance you want the laser to go in px)
- Fireball: X position = X(Fireball) + 1
- Fireball: Add 1 to alterable value A
- Create Laser at (0,0) from Fireball
Loop trigger #0
+Fireball value A >= (the distance you want the laser to go in px)
- Destroy Fireball
Laser animation stopped is over
- Destroy Laser
Then set the number of loops (X) to something high, like 25-30, and make the Laser animation much shorter.
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).
I'm doing just that and its not working at all.. Please could somebody just download what I've done below and try it out. I know its a bit selfish, but this will be a main part of my new game - and I really don't want to have to stretch to using the one object method..
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
22nd September, 2004 at 05:45:48 -
Repeat while pressed space: Start loop #0 for 10 loops
Loop trigger #0
- Create Laser at [anywhere]
- Set laser.y to ship.y
- set laser.x to ship.x + Loop Step( "Fast Loop object", 0 )
* 4
- Set alterable value A of laser to : Loop Step( "Fast Loop object", 0 )
Always
- Set laser.y to ship.y
- set laser.x to ship.x + laser.AltA * 4
laser's animation stopped is over
- Destroy laser
I have MMF so I can't give you my version. It would be in cca format.