Projects

  • Star Wars Game (in progress)

    star wars game

    The Star Wars Game was the first game I made using Turtle. It is also the most complex game I've ever made. You are a Jedi Starfighter and you have to shoot the Baddie Starfighters, which change type after 7 kills, 12 kills and after 20 kills you have to kill the Baddie Boss.

    Source Code
  • Topics learned in this project:

    • More practics on Turtle
    • Handling images
    • Collision detection

  • Star Wars Information Center

    star wars game

    Using the API at SWApi I created a Python program which asks the users for a search term and responds with information from the Star Wars universe if it matches the search term. It uses the HTTP module to send HTTP requests to the API. The response is then parsed as JSON.

    Source Code
  • Topics learned in this project:

    • Working with HTTP module
    • GET/POST HTTP requests and error codes
    • Working with APIs
    • Working with JSON
    • Practice on dictionaries

  • Painter!

    painter

    A simple but beautiful piece of program that draws the most beautiful, randomly generated piece of contemporary art in the entire galaxy! I learned the basics of Turtle with this project. It draws lines of random length, at random angles, with random pen size and colours! I could watch this running for hours...

    Source Code
  • Topics learned in this project:

    • Basics of Tutrle

  • Snake Game

    snake game

    The classic snake game. This is my most recent project in Pygame. I combined everything I had learned before, and also learned some new topics:

    snake game 2

    Game over can occur when the snake collides with the walls or with itself. The colour of the background, the snake and the food that the snake eats changes every time you either start the game or die and then restart the game by pressing "r".

    Source Code
  • Topics learned in this project:

    • For loops
    • Lists
    • Movement of objects on the screen, and how it relates to frames per second and speed
    • Collision detection
    • More about reacting to keyboard events
    • Drawing Rectangles
    • Drawing Text on the screen

  • Triangle Game

    triangle game

    The Triangle Game was the first project in which I used Pygame. I learned the basics of Pygame with this project. The game starts with a blank screen. When the user presses a certain number on the keyboard, that amount of randomly coloured, randomly placed and randomly shaped triangles will appear on the screen. For instance, if the user presses 3, 3 triangles with random colours and random sizes will appear at random positions.If the user then presses 5, another 5 will appear and so on. Space clears the screen.

    Source Code
  • Topics learned in this project:

    • Pygame coordinate system
    • Creating colours
    • Drawing triangles
    • Event loop
    • Reacting to keyboard events

  • Average Game

    average game

    It asks for numbers repeatedly, until the user types "end". The program then tells you the total of all the numbers, the number of numbers and the average of all the numbers. It then saves these results in a file called 'average.txt'

    Source Code Topics learned in this project:

    • Reading files
    • Writing to files
    • Functions

  • Holiday Cost Calculator!

    hollday booking

    A simple program that asks the user about their holiday destination, and some other information such as number of days staying there, whether they need to rent a car or not, etc. and calculates the total cost

    Source Code

    Topics learned in this project:

    • Lower and upper functions to change strings to lowercase and uppercase
    • The main goal of the task was to learn how function calling / returning works
    • More practice on previous topics

  • Guessing Game

    guessing game

    What the Guessing Game does is that you choose a number in your head, you tell the computer the range of you number (eg. 0-100) and the computer tries to guess it. It works by halving the results. For example, if you chose the range as 0-100 and the user types "G" (for Greater), then it has to be 51-100. It then updates its 'guess' to be the midpoint of the new range (75), and so on. This is why it can guess numbers with very few guesses. The algorithm, called Binary Search is described nicely here

    Source Code

    Topics learned in this project:

    • Numbers and arithmetic
    • Variables
    • Strings
    • Printing
    • Boolean expressions
    • If conditions & else
    • User input
    • While loop