Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

How to make my single-player Pong game's win/loss between the User and the Enemy random?

$
0
0
Hi! I have made a Pong game which is single-player for Android. I have just one issue : My game has a Player Paddle object which is what the Player controls. The Enemy follows the ball. The speed of the Enemy is controllable. There are different levels wherein, every level up you go, the speed of the Enemy decreases. Now if I make the speed of the Enemy too fast, it never loses. And, it never wins if it's speed is too low. How can I make the win/loss streak random, wherein the Player wins once in a while, and so does the Enemy. An answer was posted in another place but I don't have the skills to code it out as I am a beginner to Unity and would love it if someone could help me with the coding etc. that is required to execute it. It is written down : "make it so that after the enemy paddle has hit the ball it automatically returns to the (vertical) middle of the screen. only once the ball returns to the (horizontal) middle of the screen does the enemy begin following the ball again." Hope someone can help me with this. Cheers!

Viewing all articles
Browse latest Browse all 1875

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>