-
Re: 360 grenade ?
A completely custom movement is better.
Here's how to do it:
Make a grenade object with 4 Alterable Values: XPos, YPos, Velocity and DeccellerationSpeed.
Oh and one more, lifetime. Lifetime is how long you want the grenade to be active before exploding.
Set DecelerationSpeed and Lifetime in object properties to whatever. 1 second is 50 frames by default, so by default, set lifetime to 50xNumber of Seconds Active.
Then add this event in the main event editor:
-User clicks-> Clicks with Left Button:
*Create Object ("Grenade")
*Grenade->Alterable Values->Set->XPos to X("Player")
*Grenade->Alterable Values->Set->YPos to Y("Player")
*Grenade->Scale/Angle->Set Angle to Angle("Player")
Then in the behavior of the Grenade (Under Events tab in properties) put the following two events:
-Always:
*Grenade->Alterable Values->Set->XPos to XPos("Grenade")+(Cos(Angle("Grenade")*Speed("Grena de"))+0.0
*Grenade->Alterable Values->Set->YPos to YPos("Grenade")+(Sin(Angle("Grenade")*Speed("Grena de"))+0.0
*Grenade->Alterable Values->Set->Speed to Speed("Grenade")-Deceleration("Grenade")+0.0
*Grenade->Alterable Values->Subtract From Lifetime 1
-Grenade->Compare to Alterable Values: Lifetime<0:
*Grenade->Destroy.
EDIT: Also, take out the movement and put static instead.
-
Re: 360 grenade ?
Why is that better? The Vector Movement works just as well, and is much simpler than using math for a custom movement.
-
Re: 360 grenade ?
Still need help :/ can you guys look at my GRENADE section of the event editor? thnaks...
http://mfa.aquadasoft.com/view/1294346428-Help3
-
Re: 360 grenade ?
Right off the bat I can see that you're not even using the Clickteam Movement Controller at all, so it's definitely not going anywhere. Refer to Jaffob's post.
-
Re: 360 grenade ?
but i tried that and it didt work either
-
Re: 360 grenade ?
You're going to need to give your grenade the Vector Movement in its properties. ;)
-
Re: 360 grenade ?
I know but it still.didnt.. Please give me an example?
-
Re: 360 grenade ?
Dude. You used speed instead of your alterable value. That's all it is. Just go to your behavior. Replace speed("Grenade") with velocity("Grenade").
EDIT: And in reply to Jacob, my way is "better" because it can be transferred to other programming languages/game makers.
EDIT2: I looked at my post. It was my mistake. Sorry man.
EDIT3: Sorry, also add these two events to your behavior under always:
Grenade->Set Y Position->YPos("Grenade")
Grenade->Set X Position->XPos("Grenade")
EDIT4: Forget the rest of it: Here's your example fixed:
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=219160&#Post219 160