Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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.
You could do this with any behaviour you'd like..
Just change the direction on collision with wall..
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.
An object with the bullet behaviour set to bounce off solids will do this.
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.
how are your collision polygons set up?
Is the speed of the ball high enough to miss the collision?
Without any events:
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.
Added a capx to my last post..
I don't see a difference in the settings yet yours works so I am sending my capx
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..
Ok well I create a circle in paint.net then when I added the ball sprite I edited it with the built in image editor and pasted the circle in there. Apparently there is other stuff it needed that I messed up eh?
Ok so I realized what your were talking about and I went into the images and set the origins to middle. That sure helped. Thanks!
Ok so it's better. It travels to the right but when it hits the wall it bounces upward and off the screen.
Develop games in your browser. Powerful, performant & highly capable.
ok I am all set now. Delete the walls. Made new ones and it all works fine. thanks for all your help!
Arg I want to pull my hair out. I did a lot more to the sample game I am playing with and lots of stuff is working now and suddenly the stupid ball has started bouncing off the wall and going upward again. All the walls are set with zero angle and so is the ball. Going to include my file again so someone can help me. Thanks!