Update Query

Editor
Jan 31, 2010 at 2:49 PM
Edited Jan 31, 2010 at 3:19 PM

ok so i have a new problem :( sorry to keep nagging you with these.

if you run this and dont move the controller you will see that the ball moves the block after 8 hits, it is however supposed to do it after 10. as each hit is -10hp and the block has 100hp. if i step through it, 2 of the calls skip the ball movement and just -10hp off, just wondering if the method is updating correctly, or have i missed something important?

http://www.greymatterscomic.com/oxgameengine/UpdateOxanoid.zip

 

thanks again :)

bubzy.

Coordinator
Jan 31, 2010 at 3:04 PM

Checking it out now.

(I figured it out, but you might want to fix the above url for others :)

Coordinator
Jan 31, 2010 at 3:09 PM

BTW, any particular reason you're using traits in Blocks.cs?

Coordinator
Jan 31, 2010 at 3:15 PM

As to your question, it's quite likely that you have a single collision counting as two. This is just something that happens in a lot of 3D physics engines like JigLibX. You might consider making a block immune from damage that happens say, 50ms after each collision.

Editor
Jan 31, 2010 at 3:18 PM

the blocks have health. would there be a better place to put the traits?

Coordinator
Jan 31, 2010 at 3:21 PM

If a scripted object has a property like health, just add a simple C# property called Health to the script. Traits should in general be used only for metaprogramming.

Editor
Jan 31, 2010 at 3:25 PM

cool ok, i have no idea what metaprogramming is :) but i get ur point, and i dunno why i didnt do it like this anyway. probably because i did it like this initially before you told me that objects were instanced and never thought about it again :) thanks.

Coordinator
Jan 31, 2010 at 3:27 PM
Edited Jan 31, 2010 at 3:31 PM

metaprogramming is programs programming programs programatically!!!!

hehe ;)