Sprite pushing another sprite

Get help using Construct 2

Post » Sat Dec 03, 2011 7:23 pm

Last edited by Yann on Sun Sep 14, 2014 11:15 am, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Dec 03, 2011 7:37 pm

Thanks Yann 4 ur help and comments, but while the player is pushing the ball only the first frame from the pushing animation is active. Can't we make it as a loop playing the whole pushing animation frames?
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Sat Dec 03, 2011 9:57 pm

redownload (:

I set the animation to pingpong so you have a nice back&forth movementYann2011-12-03 22:00:43
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Dec 03, 2011 10:46 pm

Yann, i've looked at X < ball.x and facepalmed so much it realy hurts :/
Thank you for remembering that long ago i had a brain... :P

now@my little example (Yann gives the answer, i was hoping to give just hint so you can make it on ur own)

1. the player should be able to push the ball(Rock) from left to right slowly

Event sheet->ball on collision with player->ball set bullet speed to (how much you wish).
I understood it like you want to kick ball, not move it :P In my example setting speed to 15 should do the trick. (Also, you dont need to use here 'bullet' behaviour. I just clicked it and seen that it worked). Then when 'isPushing=false' set bullet speed to 0;

2. the player's animation should be changed from running to pushing during the pushing of the pall

Here was my mistake, cose i didnt checked it. In my example where the comment said you just need to add push animation, you will need to set isPushing=true. After that go to Player Custom Movement group and add your animation like other events there with isPushing=true statement. isPushing is a player variable that i've missed.

3. the player should not be able to push the ball from right to left or from the top.

This was already implemented in my example (yep, Yann example is faaar more wise).

@Yann
I am new to C2, just started, and in example you've made i found answers for some questions i had, thanks (i.e. finally i know why people are adding an invincible clones)vjadro2011-12-03 22:49:44
B
1
G
1
Posts: 5
Reputation: 435

Post » Sun Dec 04, 2011 8:23 am

That's perfect Yann. Million thanks 4 ur help .

I didn't know where to use the ping pong before.mina2011-12-04 08:24:39
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Sun Dec 04, 2011 5:16 pm

srry mina i didnt receive your message
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Sun Dec 04, 2011 5:20 pm

Its OK kbdmaster, Yann helps me with it.
B
303
S
6
G
5
Posts: 163
Reputation: 12,152

Post » Fri Jul 22, 2016 1:13 pm

@Yann
Brilliant example, but how to make player push stone in both directions:
when player push stone left-to-right stone moving right,
when player push stone right-to-left stone moving left?
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Wed Oct 05, 2016 7:29 pm

.newgrounds.com/dump/item/278a94a7ca82c3b7955159d4e9cbc3bf
B
3
Posts: 5
Reputation: 204

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests