Yup. And for the 'hold space' thing, add a counter to the frame. While Space is pressed AND the counter is less than 70, add 1 to this counter. While Space is NOT pressed (right click the condition and select Negate) AND the counter is GREATER than 0, create the grenade using Create New Object at the player's position, set its direction to the player's direction and set its speed to the value of the counter. Set the counter to 0.
Set Alterable Value A to well.. your bouncing system. You know, set it to 0 when it hits the ground, and increase it later, with some deceleration, etc. You could easily make a custom bouncing movement that way.
Now, to get it over an object...
If Alterable Value A ("Grenade") < Alterable Value A ("Object")...
...it'll bounce off "Object". In case you haven't figured it out, you set Alterable Value A ("Object") to the 'height' of the Object.
To make it so you have to hold space longer... then set the initial max first bounce height of Alterable Value A higher, the longer you hold Space.
Ah, I'm tired of typing. That should answer all your questions, but whether you understood it or not, is a different story .
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
How should I do it. When I make a granade a bouncing ball and make my player shoot it, it just shoots it right trough the wall. and I have remebered the colission with backdrop make granade bounce. What should I do to make it bounce off the wall?
What I usually have is some kind of animation of the grenade bouncing up and down, and use ball movement.
When this animation reaches a point, the lowest point of animation when it would hit the ground, you decrease the speed of grenade...usually in half...and play like a bouncing sound. As with colliding with walls or obstacles where you make the grenade bounce and lose half it's speed.
When the speed of the grenade is equal 0 or whatever. You stop the bouncing animation and make it look like it's animation frame where it's at it's lowest point.
The beauty of the animation is you can have some collisions only work when a certain frame of the bouncing animation is playing.
For example...if frame 4 in the animation editor...which is image 3 in the event editor...is the grenade at it's highest point, you could have an event so that the grenade will only hit another character or obstacle of some sort is the animation image is different than 4.
MUGGUS
Come and annoy me more at
www.muggus69.tk STOUT ANGER!!!
that is what I did. I made the bouncing ball movment, but the problem is that when I do the upon pressing space = shoot granade event, it just passes right through the wall
Hmm, been so long since I've used the direction calculator. I think I'm thinking of the right object...
--Create Grendade--
then right under it
Flag 0 of Grenade = off
--rotate towards mouse(using dir calculator for 360 dir bounces)(set the rotate value high enough that it doesn't visibly rotate)
--Set flag 0 on.
If you want the easy way just creat the ball objecct and set it's direction to the direction of your character (in the expression editor, under direction) IN THE SAME EVENT. Shot objects don't behave exactly according to the usual rules.
Why the hell am I on the computer at 1 in the morning? No, don't answer.
For the firing event for a grenade that bounces you should have an event like this...
- Player presses fire
Create Grenade relative to Player at Action spot, located towards direction of player
Set direction of Grenade to Dir("Player")
Start movement of Grenade
Set Speed of Grenade to 100...or whatever
You probably don't need those last two events...but just in case.
Note: The order of the actions is important! Make sure the first action executed for this event is the create Grenade action.
MUGGUS
Come and annoy me more at
www.muggus69.tk STOUT ANGER!!!
Strange... not to sound arrogant or anything, but this is just one of those things that's just so painfully obvious to me that I just don't feel like explaining it. I mean, I thought someone would fully explain it or you'd be able to figure out how to animate. I guess it's a natural thing, like how some people could draw animations nice and I can't do a 3-frame animation that looks right.
All right... I'll try to explain it as simple as possible. I'm assuming you want one based on realistic physics, and not just a simple remodified bouncing ball movement thing :
Let's say Alterable value A (AVA) = Y position of grenade (or Z position or whatever is "up")
Code your own 'gravity' or 'bouncing' movement for the Y position. You know, something like "Every decisecond, AVA > 8 --> subtract 1 from AVA" and vice versa to make it bounce back up.
Now let's say Alterable Value B (AVB) = height
When AVA("grenade") > AVB("object") --> Bounce
When AVA("grenade") > AVB("object") --> Nothing happens
Now let's say the XY movement is what moves it around. I could explain on how to make your own top-view movement, but an easy way would be to use the bouncing ball movement, with deceleration. So the longer the object moves, the lower the speed. If you want, you can use AVC to track speed, but if you're as lazy as me, just subtract it after a few seconds or after a 'bounce'.
Now for the hold space thing... just set initial speed & maximum AVA higher the longer you hold it. Let's say AVC is your initial speed. You know, conditions with "User holds down Space, AVC < 70 --> Add 1 to AVC" will give you a max initial speed of 70.
As for animating it, just set frame to AVA. The higher the frame number, the closer the grenade is to the screen (the higher the grenade).
There... if you STILL can't figure it out by next time I'm online (probably next month), I'll write an engine for you and bag myself an extra 5 DC points for it .
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.