Journal

I created a sprite for a box. Using a random locator and rect codes.

 

maxresdefault.jpg

 

 

 

for i in range(50):
 
block = Block(BLACK, 20, 15)
  
block.rect.x = random.randrange(screen_width)
block.rect.y = random.randrange(screen_height)
 
block_list.add(block)
all_sprites_list.add(block)
Advertisements

Journal #9

In this section I learned about classes and made a code using the person class

 

 

d6ac327f-f4ce-4bcb-86fc-16bd095b2ae3

class Person():
def __init__(self):
self.name = ""
self.money = 0
bob = Person()
bob.name = "Bob"
bob.money = 100
nancy = Person()
nancy.name = "Nancy"
print(bob.name, "has", bob.money, "dollars.")
print(nancy.name, "has", nancy.money, "dollars.")
This identifies nancy and bob as persons in the game.

Journal #8

ellie_the_elephant_2

Today I learned basic code for drawing shapes
I made this code for making arcs to create an eclipse
pygame.draw.arc(screen, GREEN, [100,100,250,200], PI/2, PI, 2)
pygame.draw.arc(screen, BLACK, [100,100,250,200], 0, PI/2, 2)
pygame.draw.arc(screen, RED, [100,100,250,200],3*PI/2, 2*PI, 2)
pygame.draw.arc(screen, BLUE, [100,100,250,200], PI, 3*PI/2, 2)

Journal

This week I learned about looping and made an example code for a basic loop.

game_loop
for i in range(5):
print(“I will not chew gum in class.”)

This will output a basic string 5 times saying you will not chew gum.

Journal #7

At this point I learned about if and else statements.
15_32.jpgFor this I have made a code for a logic puzzle that uses if and else

 

#Logic puzzle from

#https://www.brainbashers.com/showpuzzles.asp?puzzle=ZFSC

print (“During a recent police investigation, Chief Inspector Stone was interviewing five local villains to try and identify who stole Mrs Archer’s cake from the mid-summers fayre. \nBelow is a summary of their statements \nArnold: it wasn’t Edward

\n it was Brian.\nBrian: it wasn’t Charles \n it wasn’t Edward.\nCharles: it was Edward \n it wasn’t Arnold \nDerek: it was Charles\n it was Brian. \nEdward: it was Derek\n it wasn’t Brian.

It was well known that each suspect told exactly one lie. Can you determine who stole the cake?”)

user_name = input(“Who stole the Cake? “)

if user_name.lower() == “Charles”:

print (“You are correct! Great work!”)

else:

print (“You are wrong.”)

 

Journal #6

This week I began learning python in order to eventually code a game for my raspberry pi.how-to-crack-wifi-passwords
I sourced my information from http://programarcadegames.com/index.php?chapter=foreword&lang=en#section_0

I worked on a very basic project where I essentially created a tax calculator. I used basic calculating functions and use of variables and an integer function.

tax = 1.12

price = input(“Insert Price Here:”)

price = float(price)

total = price * tax

print (“Your final price is:”, total)

 

Journal Week 5

Now you should be done with building the cabinet. From this point you will be installing the retro pie OS onto the raspberry pi 2. I recommend downloading the retro pie image from the official retro pie site.
retropieprojectlogofinish

First you will want to reformat you sd card using http://www.softpedia.com/get/CD-DVD-Tools/Data-CD-DVD-Burning/Win32-Disk-Imager.shtml

Then you will need to put the image file onto your micro SD card.

At this point you should get your roms from whatever website you will be using. And put the roms into the directory folder in the SD card.

After this you will need to start up the Raspberry Pi 2. Assuming that ends up working you will then have the emulator working from there I recommend checking that all the buttons are working and if not recheck the control board to see if anything became loose.

 

Checklist

  1. Make sure you have completed the cabinet and have all the components in.
  2. Reformat your sd card
  3. Add the image file and the roms.