Page 1 of 1

Cannon War

Posted: Tue May 06, 2008 9:51 pm
by myraneal
Hey everyone,
I've only used ZGameEditor for about a week and a half now but I like it a lot! So you can probably tell I'm still learning the ropes and to expedite the learning process I wanted to make one of those games where you have two cannons that are trying to shoot each other.
I actually ran into quite a bit of problems with this project, which is mainly why I'm posting this here; to seek help.
The problem I'm currently having is this: The cannonballs that are launched from the single cannon have a lifetime of 5 seconds. At the end of their lifetime, I want a really simple particle effect to take place. I tried rendering this effect in OnRemove of the BallModel but that didn't work. I'm now trying to Spawn a ParticleEffect model, which all it does should be to display the particle effect and then die, but that doesn't seem to work either. I made sure that the two components I use to render the particle effect work because when I put them under OnRender of the ZApp, it shows me the particle effect correctly at 0,0,0.
So I'm uploading my project file to this post and if anyone could take a look and tell me what I'm doing wrong, I'd be very grateful.
Thanks,
Yılmaz

dont do more work then you need to,.

Posted: Wed May 07, 2008 2:59 am
by jph_wacheski
looks to me like you are doing way more work than you need to,. just use timers to remove stuff when it is no longer drawing anything.

I just looked quickly but if i find the time,. i will see what else I can help with,. the attached file has the parts blowing up real good,.

peace.

Posted: Fri May 09, 2008 11:32 pm
by myraneal
Thanks very much jph! This definitely helped.
You are right about doing more work than I need to. I had totally forgotten about timers so I was keeping track of time myself, which is (in most but not all cases, mind you) totally unnecessary :D
Here's an improved version of the game. Still quite incomplete but it's getting there. I also added a Pause feature, just hit the 'p' key. It does have a 0.4 sec keyrepeat delay however, because if I don't put that delay then you end up pausing and unpausing the game right away when you just tap the key.
W and S keys for P1 angle, E to shoot from P1, Up and Down arrow keys for P2 angle, L to shoot from P2. P to pause.

Thanks,
Yılmaz