Hi all Greetings from Sweden!
This time i've really tried before posting but after a while i get tired and eger to finish todays goals and start gaming some "real" games (Rainbow Six) =)
Well i think theres more people out there who needs to now the following aswell.
The thing is that i want to throw a grenade. I have got it to work as far as the grenade is moving +1 for ever 0.350th of a sekund and depending on how strong the throw is it goes different far away from its origin (the players hand). The nade also has collission checks and it explodes after 3sec after it has landed on ground. So im almost happy with it.
But now i want it to go in a realistic bow (dont know the english word). Anyway this is my code (the not working one):
Sry if the code dont match on web...
Can anyone help?
Thanks!
This time i've really tried before posting but after a while i get tired and eger to finish todays goals and start gaming some "real" games (Rainbow Six) =)
Well i think theres more people out there who needs to now the following aswell.
The thing is that i want to throw a grenade. I have got it to work as far as the grenade is moving +1 for ever 0.350th of a sekund and depending on how strong the throw is it goes different far away from its origin (the players hand). The nade also has collission checks and it explodes after 3sec after it has landed on ground. So im almost happy with it.
But now i want it to go in a realistic bow (dont know the english word). Anyway this is my code (the not working one):
Function Update_Grenade() For ThisNade.NadeType = Each NadeType If ThisNade\State = 1 Then;If its moving If (MilliSecs() + 350.0 > ThisNade\MovingTimer#) Then (ThisNade\ThrowPower#/10.0) ThisNade\X# = EntityX(ThisNade\Ent) ThisNade\Z# = Float((ThisNade\Z# + ThisNade\MovingTimer#)) ThisNade\Y# = Float((ThisNade\Y# + (ThisNade\Z# * ThisNade\Z#))) PositionEntity ThisNade\Ent,ThisNade\X#,ThisNade\Y#,ThisNade\Z# ThisNade\MovingTimer# = MilliSecs() EndIf If Abs(EntityX(ThisNade\Ent,1)) > 10000 Then FreeEntity ThisNade\Ent Delete ThisNade ElseIf Abs(EntityY(ThisNade\Ent,1)) >10000 Then FreeEntity ThisNade\Ent Delete ThisNade ElseIf Abs(EntityZ(ThisNade\Ent,1)) > 10000 Then FreeEntity ThisNade\Ent Delete ThisNade ElseIf ThisNade\ThrowPower# <= 0.0 Then ThisNade\ThrowPower# = 0.0 ThisNade\DetonateTimer# = MilliSecs() ThisNade\State = 2 EndIf ElseIf ThisNade\State = 2 Then;Has stopped TranslateEntity ThisNade\Ent,0,Gravity#,0 If MilliSecs() > (ThisNade\DetonateTimer# + 3000.0)Then DetonateNade(ThisNade\Ent) EndIf EndIf Next End Function
Sry if the code dont match on web...
Can anyone help?
Thanks!