Not Pong

Today I put all of my coding knowledge together and coded this emulation of pong. It’s not finished but the difficult parts are done. The bats move and collision detection is sorted. I need to add scoring and to fancy it up with bell and whistles.

I’m on to learning about Object-Oriented Programming (OOP). This is the bit I have been looking forward to. From here I can programme a lot of things. My first goal is to rte code the not_Pong using OOP.

Below behold the game.

This is my emulation of pong in processing


A little colour

A more colourful sketch than I have been doing of late.

This uses FOR loops to draw the squares along the x axis; and another to draw the squares on the y axis.

The colour is controlled by the mouse movement. Long details below.

The colour in processing is by default set up as (red, green,blue). It's basically colour mixing with light.

The red component in the sketch is defined by the distance of the x co -ordinate of the mouse minus the x value of the square on the grid it is over , expressed as an absolute. ( which means its a positive number at all times. ).

The green component is defined by the y coordinate of the mouse minus the y value of the square it is over expressed as an absolute.

The blue component is defined by the mouse's x coordinate minus the width divided by two expressed as an absolute.

Yeah I know. My brain did that many many many times. But now I know what it all means and how it works. So I can actually write this stuff. Yay elastic brain learning.