How do I make a ball sprite roll back and forth between wall

Just started using Construct 2? Post your questions here

Post » Tue Sep 16, 2014 4:58 pm

I am trying to figure out how to make a ball sprite roll back and for on a platform between two walls. I tried bullet but only goes one way.

Thanks. I am totally new at this.
B
5
Posts: 11
Reputation: 223

Post » Tue Sep 16, 2014 9:07 pm

You could do this with any behaviour you'd like..

Just change the direction on collision with wall..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 17, 2014 5:30 pm

I don't even know how to make the ball roll in the first place. I want it to automatically start rolling back and forth between walls when the game starts. It will be an obstacle to the player to jump over. I am totally new to this. I tried using bullet but it just goes one way.
B
5
Posts: 11
Reputation: 223

Post » Wed Sep 17, 2014 5:33 pm

An object with the bullet behaviour set to bounce off solids will do this.
B
64
S
25
G
10
Posts: 657
Reputation: 10,848

Post » Wed Sep 17, 2014 5:43 pm

Ok I added bullet & solid to the ball. Put up walls on each end of the viewport and set the bullet behavior to bounce off of solids. The walls have solid as well. But what happens is the ball just runs thru the right wall and disappears.
B
5
Posts: 11
Reputation: 223

Post » Wed Sep 17, 2014 5:52 pm

how are your collision polygons set up?
Is the speed of the ball high enough to miss the collision?

Without any events:
You do not have the required permissions to view the files attached to this post.
Last edited by LittleStain on Wed Sep 17, 2014 5:58 pm, edited 1 time in total.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 17, 2014 5:56 pm

Set speed down to 100. Checked the collision polygon as well. Still going off the screen. I have solid on the walls and solid and bullet on the ball.
B
5
Posts: 11
Reputation: 223

Post » Wed Sep 17, 2014 5:58 pm

Added a capx to my last post..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Sep 17, 2014 6:16 pm

I don't see a difference in the settings yet yours works so I am sending my capx
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 11
Reputation: 223

Post » Wed Sep 17, 2014 6:23 pm

Firstly, I have no idea how you did it, but all your origins are way out of your sprites..
and if the ball is only going left and right there is no need for a round collision-polygon, for it wil make the bounces way less predictable..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest