top of page

Unit 10

Doodle

At first flash was confusing having to work with layers and them using programming you have to join them together. The biggest problem eith this doodle was understanding where you are supposed to code and what the code you are typing is controling. Once I understood how the software works the rest was a breeze as I have programming experience in Python, so all it took was learning flash's syntax which is very similar to python and java.

Approaching Pong I had a good idea on how I want to program it without the need to do a pseudocode or a flow chart. I forst made the ball bounce around making sure it retains its speed when bouncing off walls. Due to the way that I programmed the movement of the ball (teleporting a few pixels every frame) at one point it always passed the wall by a small amount but sometimes it even prevented the ball from boucing back so it would get stuck in the wall. I countered that by making the wall really thick and then also the ball has no possibilty to get stuck as it will get teleported just outside the wall. This will 100% prevent the ball from being stuck. 
To enchance the gameplay I changed the rules of pong a bit. Instead of the ball starting in the middle and shooting off in a random direction, I made it so that if the ball starts on the opposite side to which player will have to hit it first. This is to prevent the quick and unfair start in the original pong, therefore both players have the same time to react to the ball.

​

Another addition I made to the game was the steady increase of dificulty to prevent absurdly long rounds. Every time the ball hits a pad it will increase its speed by one, this will result games being much more intense. When the ball hits the right pad simply putting +1 to speed works since it will be reversed, but on the left pad if you add to the speed it will slow down as the ball moves by + meaning right and - meaning left, so I had to to a -1 speed for the left pad.
I was debating wether to make the ball have a sligt curve or some gravity to make the game harder which will make it more enjoyable but never the less I decided not to as that will not stay true to Pong.

​

Making the graphics of Pong required me to make several new layers, for example to make my pads I used photoshop to design my pads with a gradient, programmed the so that they ONLY move when the players press buttons, the pads with the hitboxes for the ball are invisible underneath my new pads.

​

To make sure the game doesn't start off whenyou load the web page I made a requirement that the player has to click the flash player. This will not only start the game when you are ready but it will also tell the browser that you are inputting controls to the flash instead of using up and down to scroll the page.

This the same way the ball was programmed to bounce around. The user can click the screen to increase the balls speed and abounce, which at first caused a lot of problems. The main problem was the acceleration of the ball when clicked, because if I multiply the speed, the lower speeds will have vey little change to speed and at higher speeds the change will b too much. I also can't just add the speed as it will be fine in some areas but not noticable later on. So I had to find a balance between multiplying and adding speed. If I was to simply add positive numbers to the speed the ball will only accelerate in one direction and decelerate in the other. I made gravity by just slowing down the y axis movement until it becomes negative, I also made the ball more realistic by taking away x axis movement every time it hits a wall or the ground.
To make the ball show the james bond background I simply made it a dynamic mask.

Ultimate Pong

Controls

W,A,S,D player 1
UP,DW,L,R player 2

The Ultimate Pong forces the player to control two pads: one for horizontal movement and one for vertical. This incredibly ups the difficulty of the game.

In my Older version of Pong I used the top and bottom walls to just make the ball bounce off it, but I had to change it to make the ball reset when it touches the wall and add score to the corresponding player. The challenge was making the ball bounce off the new pads, as most of the time when the ball touches the pad it will either not change direction at all or it will do a complete 180-degree turn.
The game is in a widescreen resolution, therefore the horizontal pads have a lot more ground to cover. to compensate for this the horizontal pads more slightly faster. Not too little but also not too fast so that the players don't have to control 2 very different sensitivities.

This is the updated ball code that registers and responds to the top and bottom pads.

bottom of page