FML PONG

IN THIS WEEKS LECTURE:

“you have 45 minutes to make pong, get to it. Also, here’s GitHub and itch.io, they are your world now”

FMLPONG2

It took me about 10 hours finish making the game, but the end product is quite fun. The paddles are nothing special, and the enemy AI just moves towards the ball’s height, with a limited speed. Nice and simple. However, the ball itself is a tricky character; it rotates by a random amount every time he hits a paddle, and every frame adds force to its local positive x axis, meaning that the ball travels in sometimes very strange patterns.

I spent ages refreshing myself with how to use certain bits of code with the unity API’s, but found that the plan of what had to be done came fairly easily.

There are four scripts, one for the players paddle, one for the AI, one for the ball and one for a game controller. The game controller, ball and AI all run methods from each other, and the ball is a prefab that is destroyed and spawned for each new set, the AI finds the ball every frame by searching for its tag so that the ball can be destroyed when needed. The game controller keeps track of the scores, sets the text boxes to the appropriate messages and handles exiting and resetting the game.

so It’s all working fine, I fixed a bug where the death zones were too small and the ball could escape, and I had a browser version running too. Then my brother suggests multiplayer. So I got that done with very little fuss too!

Itch.io is awesome, has simple to use tools to present my game in a nice professional meets gamer style, and helps me keep track of the popularity of those games.

I’m looking forward to learning more about source control and how to use GitHub more effectively (like committing every 20-30 mins instead of after 10 hours of work. I was on a roll, will avoid from now on).

Here is a link to the game, for free!

http://benwelsh.itch.io/fmlpong

I got the font used in game here:

http://www.fontspace.com/codeman38/press-start-2p 

And followed this tutorial to figure out how to display text on screen:

https://unity3d.com/learn/tutorials/projects/roll-a-ball/displaying-text

I made the game sounds using this:

http://superflashbros.net/as3sfxr/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s