Cannon War

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

Post Reply
myraneal
Posts: 26
Joined: Tue Apr 08, 2008 8:00 pm

Cannon War

Post 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
Attachments
cannonshoot.zip
(11.73 KiB) Downloaded 679 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

dont do more work then you need to,.

Post 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.
Attachments
cannonshoot_jph1.zip
try this,.
(5.31 KiB) Downloaded 589 times
iterationGAMES.com
myraneal
Posts: 26
Joined: Tue Apr 08, 2008 8:00 pm

Post 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
Attachments
cannonshoot.zgeproj
(42.99 KiB) Downloaded 600 times
Post Reply