Universe Code.

Blitz3D Forums/Blitz3D Programming/Universe Code.

Guy Fawkes(Posted 2009) [#1]
Hi all. Can someone help me make it so that the particle doesn't KEEP starting, it only starts once then when it ends, it RESTARTS? I don't need you to try it yourself, I simply need a variable fix for the variable called "Bang"..

I'm having some variable trouble.

Code:




D4NM4N(Posted 2010) [#2]
I can take a proper look next time i am on my windows machine (unless someone gets there first).

One thing i did notice is this:

If SPEED# = 0 and bang = 1

you cannot do that with a floating point. X#=0 is almost always a non-condition (or at best a HIGHLY unreliable one -in any language).
try this line instead:
if speed>-0.0001 and speed<0.0001 and bang = 1 ;(or however 'sensitive' you need it to be)

It appears you have more than one of these, look through and change accordingly. If it is not your problem, it certainly is not helping.


You should really use proper indentation, because it is hard to read it.


D4NM4N(Posted 2010) [#3]
lol, i revisited this and my kbd went nuts and posted crap!... time for a reboot(or new kbd) i think :D


xlsior(Posted 2010) [#4]
if speed>-0.0001 and speed<0.0001 and...


Or alternatively:
[code]if ABS(speed)<0.0001 then...[/quote]


D4NM4N(Posted 2010) [#5]
True (and perhaps faster??) for a zero test, TOMAYTO TOMARTO! ;)

(although it would get a bit long winded for values other than 0 :P