i got the assignment to make a breakout game. i only know the basics of unity on the c# side. does any one maybe have some tutorials or sites where to find info that might be useful for a breakout game. it is for learning purposes only, there is no need for proffesional coding, just something to get met starting.
I know, but most projects on the unity site are way to complex for me, i will try and find some good things in the documentation, but i will probably have the most problems with the bouncing against walls, since i have absolutely no idea how to do that.
Ps, why did any one vote my question down? is this a stupid question? if so, i’m sorry, i just needed help and this seemed like the best place to start with
If I was making a Breakout-style game in Unity, I would probably do it a bit differently than most people would. I would try using physics for the ball.
Of course, keeping with the fact that the ball doesn’t “fall” in Breakout, just bounce endlessly, there are a few settings you would have to change. First, disable gravity. Second, make sure your ball and everything it collides with has a bounciness that disallows the ball to slow down as it impacts objects. Experiment with physics, and read the manual.
Lock the ball to a fixed position on the Z-axis, so it doesn’t fly back or forward. The inspector on a rigidbody can be used to lock this.
The paddle is a simple rectangular object with a collider attached and a script that allows left/right movement. Translation is used here.
The blocks award points on destruction, destruction being caused by collisions from the ball. Use OnCollision and other tidbits. Again, read the manual for these.
What you want is a script that reflects its direction against the normal of the surface it hits and then if it hits a block, the ball should destroy the block and points should be added to the score. You can make an array with all the blocks and when that array is empty, load the new level.
A breakout game should involve most of the same procedures as most other games or Unity projects. You should therefore be doing well with reliance on the regular documentation that came with Unity and which can be found on the net.