Tag: Coordinates

The Honeycomb Challenge


Honeycomb is a structure of hexagonal cavities (cells of wax), made by bees to store honey and eggs. In this challenge we will use a set of iterative algorithms to draw a honeycomb pattern. First, we will create a function

Pentagram Challenge


A polygon is a plane shape (2D) with straight lines. It consists of vertices and edges. A polygon is regular when all angles are equal and all sides are equal. For instance a regular pentagon consists of 5 vertices and

Estimating Pi using the Monte Carlo Method


One method to estimate the value of π (3.141592…) is by using a Monte Carlo method. This methods consists of drawing on a canvas a square with an inner circle. We then generate a large number of random points within

Python Turtle – WordArt Challenge


In this challenge we will use Python Turtle to draw text on screen and customise the appearance of our text. To do so we have created our own font as a Python dictionary. Each letter of the alphabet is represented

Confetti Artwork Challenges


For these challenges we will produce on screen artwork by randomly positioning confetti on different shapes of canvas. Our code will use Python Turtle to draw the canvas and the confetti. Square Canvas Check how the code provided below randomly

Confetti Challenge


In this Python challenge we will write a script to randomly draw confetti on a canvas while ensuring that none of the confetti overlap with each other! Problem Decomposition In this challenge we will need to solve the following problems:

Falling/Scrolling Object Algorithms

Scrolling/Falling Object Algorithms

In many arcade video games objects are flying across the screen (either vertically: falling objects, upcoming cars in car racing game) or horizontally (e.g. pipes in Super Mario or flappy bird, cars in Crossy Road). In frame based games, motions

Pacman Ghost Algorithm


In a game of Pacman a specific algorithm is used to control the movement of the ghosts who are chasing (running towards) Pacman. For this challenge we will assume that ghosts can walk through walls (as ghosts do!). So we

Bouncing Algorithm


Bouncing algorithms are often used in arcade games such as Pong or Breakout. To understand how to implement a bouncing algorithm, it is essential to understand how the computer controls the trajectory of a sprite (e.g. ball) on the screen.

Closest Player Detection Algorithm

Edge Detection & Bouncing Algorithm

Have you ever noticed when playing a team sport video game such as a (football, basketball, rugby game, etc.) the computer often finds out who the closest player to the ball is so that you can run to the ball