From eef36257a54b0445c76ddea22ba67571e9e03f24 Mon Sep 17 00:00:00 2001 From: Sarah Lasonia Date: Sat, 21 Jul 2012 14:37:36 +0930 Subject: [PATCH 1/4] Added 'os' to the include, starting collision tests. --- main.py | 11 ++++++----- player_info.pyc | Bin 2929 -> 3001 bytes 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index ddb42ad..3df2a60 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ +#Alpha, with Sarah Lasonia's edits! RasPi FTW! +#2012 -#test - -import pygame, random, time, player_info, moveable_dude +import pygame, random, time, player_info, moveable_dude, os from pygame.locals import * pygame.init() @@ -32,13 +32,14 @@ bgmusic = pygame.mixer.music.load("backgroundmusic.mp3") pygame.mixer.init() # pygame.mixer.music.play(-1) As requested until we finish - +#brb #Display the ship player = player_info.Player(screen) alien = player_info.Alien(screen, clock) move = moveable_dude.MoveableDude() -allSprites = pygame.sprite.Group(player) +allSprites = pygame.sprite.Group(player, enemies) +Group.add( moveable_dude.initialiseDudes(10) #Creds to Cakez0r for helping me out with this diff --git a/player_info.pyc b/player_info.pyc index 15455f509c692036e2d0e533c1736edb0fcd7b75..b0da108de4a153305ebe2fd1d919a0803af165d3 100644 GIT binary patch delta 477 zcmew;wo{yq`7z* zQ}arSW85=KJW7*df&x54GV=2#e`NYho<@F_PvmLTVa+8== Uoh;84O`gW3TovSL^x)P60MqEIF8}}l delta 405 zcmdlf{!xsL`7 Date: Sat, 21 Jul 2012 14:40:49 +0930 Subject: [PATCH 2/4] Removed useless, made mouse invisible on window --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 3df2a60..ce1e536 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ #Alpha, with Sarah Lasonia's edits! RasPi FTW! #2012 -import pygame, random, time, player_info, moveable_dude, os +import pygame, random, time, player_info, moveable_dude, os #they forgot os -.- from pygame.locals import * pygame.init() @@ -11,6 +11,7 @@ center = [320,240] centership = [288,226] pygame.display.set_caption("Raspithon Game") +pygame.mouse.set_visible(False) font = pygame.font.Font(None, 32) @@ -32,7 +33,6 @@ bgmusic = pygame.mixer.music.load("backgroundmusic.mp3") pygame.mixer.init() # pygame.mixer.music.play(-1) As requested until we finish -#brb #Display the ship player = player_info.Player(screen) From 6c5e2e968f1eec76dd166a71722840997588e7b3 Mon Sep 17 00:00:00 2001 From: Sarah Lasonia Date: Sat, 21 Jul 2012 14:58:24 +0930 Subject: [PATCH 3/4] Randomised titles :D --- main.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index ce1e536..38cb409 100644 --- a/main.py +++ b/main.py @@ -1,17 +1,32 @@ #Alpha, with Sarah Lasonia's edits! RasPi FTW! #2012 -import pygame, random, time, player_info, moveable_dude, os #they forgot os -.- +import pygame, random, time, player_info, moveable_dude, os # They forgot os -.- from pygame.locals import * +from random import randint + +randnum = randint(2,3) # 1 to 4, code is inclusive pygame.init() +if randnum == 1: + rand = "Oh no, not the Aliens!" + +if randnum == 2: + rand = "Spaaaccceee!" + +if randnum == 3: + rand = "Developed by the RasPi Community!" + +if randnum == 4: + rand = "Cheeseburgers are tasty." + screen = pygame.display.set_mode((640,480), 0) screensize = screen.get_size() center = [320,240] centership = [288,226] -pygame.display.set_caption("Raspithon Game") -pygame.mouse.set_visible(False) +pygame.display.set_caption("Raspithon Game | A collaborative Project | " + rand) +pygame.mouse.set_visible(False) # We don't want the mouse to block the way. font = pygame.font.Font(None, 32) @@ -38,8 +53,7 @@ player = player_info.Player(screen) alien = player_info.Alien(screen, clock) move = moveable_dude.MoveableDude() -allSprites = pygame.sprite.Group(player, enemies) -Group.add( +allSprites = pygame.sprite.Group(player) moveable_dude.initialiseDudes(10) #Creds to Cakez0r for helping me out with this @@ -85,4 +99,4 @@ pygame.quit() - \ No newline at end of file + From f3dd5a82b6cf13500b31705ec12f3df3037c6e4d Mon Sep 17 00:00:00 2001 From: Sarah Lasonia Date: Sat, 21 Jul 2012 15:07:28 +0930 Subject: [PATCH 4/4] Randomised Titles added --- main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 38cb409..7d1f15a 100644 --- a/main.py +++ b/main.py @@ -9,23 +9,23 @@ pygame.init() -if randnum == 1: +if randnum == 1: # Sarah added randomised titles. rand = "Oh no, not the Aliens!" -if randnum == 2: +if randnum == 2: # Sarah added randomised titles. rand = "Spaaaccceee!" -if randnum == 3: +if randnum == 3: # Sarah added randomised titles. rand = "Developed by the RasPi Community!" -if randnum == 4: +if randnum == 4: # Sarah added randomised titles. rand = "Cheeseburgers are tasty." screen = pygame.display.set_mode((640,480), 0) screensize = screen.get_size() center = [320,240] centership = [288,226] -pygame.display.set_caption("Raspithon Game | A collaborative Project | " + rand) +pygame.display.set_caption("Raspithon Game | A collaborative Project | " + rand) # Sarah added randomised titles. pygame.mouse.set_visible(False) # We don't want the mouse to block the way. font = pygame.font.Font(None, 32) @@ -89,9 +89,9 @@ #On keypress keystate = pygame.key.get_pressed() - if keystate[pygame.K_RIGHT]: + if keystate[pygame.K_RIGHT]: # Key right player.turnRight() - if keystate[pygame.K_LEFT]: + if keystate[pygame.K_LEFT]: # Key Left player.turnLeft() if keystate[pygame.K_F12]: moveable_dude.initialiseDudes(900)