Wednesday, 10 May 2017

Problem solving with Python

Over the last two weeks I have been using Python. I've been learning to use computer language to create a game by writing code. I have been using 3 platforms to understand the language so i can give the computer some information to run the code. I understand that the instructions given to the computer makes the command work. This means if I make a mistake like writing it wrong it wont work. So I will have to go back and check the code.


Setting up the game
Setting up the game in the python IDLE window has been a step by step process and I have realised that to make the game work I have to open up IDLE window and use Pygame that is already downloaded on the computer. Once the window is opened I created a new template file which is the basic game  

 # 1. Pygame template - skeleton for a new pygame project
import pygame
import random

# 2. This code is for setting up the window width, height and there rate  that the  frames of the group change

WIDTH = 360
HEIGHT = 480
FPS = 30

# 3. Define colors by understanding  that the red, green and blue


RED=(255, 0, 0)
GREEN=(0, 255, 0)
BLUE=(0, 0, 255)

Problem solving
I managed to write the code  following

Game loop






Using python with 3 different platforms








No comments:

Post a Comment

Reflection Week 3

This week I learnt about 2 games called Ki O Rahi and Ti Uru. When I was playing Ki O Rahi it got a bit confusing because there was a lot of...