Skip to content

Commit

Permalink
FINAL VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Funk committed Feb 3, 2016
1 parent 3fe4a7c commit af36e2f
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 38 deletions.
3 changes: 2 additions & 1 deletion Hindernis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self, sprite, moveSpeed, mass, feuerrate):
self.sprite_iterator = 0
self.body = pymunk.Body(self.mass, pymunk.inf)
self.kugel_counter = 0
self.endgegner = False



Expand Down Expand Up @@ -211,7 +212,7 @@ def slow_space(self, body, gravity, damping, dt):

def make_sprites(self):
for i in range(0,7):
x = self.sprite.get_image(self.spalte * self.sprite.sprite_sheet.get_width()/7 + 10 , 80, self.sprite.sprite_sheet.get_width()/7 - 50 , self.sprite.sprite_sheet.get_height() -100).convert()
x = self.sprite.get_image(self.spalte * self.sprite.sprite_sheet.get_width()/7 + 10 , 90, self.sprite.sprite_sheet.get_width()/7 - 10 , self.sprite.sprite_sheet.get_height() -180).convert()
x = pygame.transform.scale(x, (250, 175)).convert()
self.sprites1.append(x)
self.sprites2.append(pygame.transform.flip(x,True,False))
Expand Down
49 changes: 19 additions & 30 deletions Level.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
(0,0,100,4500), # [28]
(100,0,6000,100),
(300,300,150,100),
(3650,3190,200,10)]
(3650,3190,200,10)
]
# Inhalt der Tupel: (left, top, width, height,size,text)
tut_textboxes = [(200,3700,800,60,35,"Welcome to the tutorial of 'The Random Run'"),
(600,4100,350,40,25,"Press 'Space' to jump"),
Expand Down Expand Up @@ -135,7 +136,8 @@
(3850, 1950, 50, 100), # 31
(4050, 1600, 50, 250), # Auskommentiert!?
(4300, 2100, 50, 50),
(0,2500,50,550)]
#(0,2500,50,550)
]

#Boden Gegner: (Block, Geschwindigkeit, Sprite, Masse,Feuerrate)
w1_boden_gegner = ((2, 3, zyklop_sprite, 50, 100),
Expand All @@ -159,41 +161,28 @@
#LEVEL2
###########Blöcke###################
# Inhalt der Tupel: ( left, top, width, height)
w2_blockkoordinaten = [(100, 5000, 100, 50),
(200, 4900, 100, 50),
(300, 4700, 100, 50),
(400, 4400, 100, 50),
(500, 4100, 200, 50),
(600, 3600, 100, 50), #5
(1000, 3600, 100, 50),
(1450, 3600, 200, 50),
(2000, 3600, 700, 50),
(2700, 3100, 100, 50),
(1900, 3600, 100, 50)#10
,(3900, 4000, 100, 50),
(4100,3100,100,50)]
w2_blockkoordinaten = [(100, 5000, 100, 50), (200, 4900, 100, 50), (300, 4700, 100, 50), (400, 4400, 100, 50), (500, 4100, 200, 50), (600, 3600, 100, 50),
(1000, 3600, 100, 50), (1450, 3600, 200, 50), (2000, 3600, 700, 50), (2700, 3100, 100, 50), (1900, 3600, 100, 50)#10
,(3900, 4000, 100, 50)]

#Boden Gegner: (Block, Geschwindigkeit, Sprite, Masse,Feuerrate)
w2_boden_gegner = [(2,10,alien_sprite,1,22),
(2,10,alien_sprite,1,22)]
w2_boden_gegner = []
#Fliegender Gegner: (anfang, ende, topOrleft, Geschwindigkeit, Sprite, Masse,Feuerrate, Waagrecht oder nicht (Bool, standart true))
w2_flug_gegner = [(2850, 3150, 3100, 5, pacman_sprite, 10, 125, True),
(3200, 3550, 3100, 5, pacman_sprite, 10, 125, True),
(3600, 3900, 3100, 5, pacman_sprite, 10, 125, True),
(3100, 3500, 4000, 5, pacman_sprite, 10, 125, False),
(3600, 4000, 4000, 5, pacman_sprite, 10, 125, False)]
w2_flug_gegner = [(2850, 3150, 3100, 5, pacman_sprite, 10, 125, True),(3200, 3550, 3100, 5, pacman_sprite, 10, 125, True),(3600, 3900, 3100, 5, pacman_sprite, 10, 125, True),
(3100, 3500, 4000, 5, pacman_sprite, 10, 125, False), (3600, 4000, 4000, 5, pacman_sprite, 10, 125, False)]
w2_powerups = [("highjump", 4), ("dash", 6), ("highjump", 8)]
w2_speichpunkte = [9]
w2_steine= []
w2_portal = 12
w2_portal = 11


#LEVEL3
###########Blöcke###################
# Inhalt der Tupel: ( left, top, width, height)
w3_blockkoordinaten = [(50,2000,350,80),
w3_blockkoordinaten = [(150,2000,300,80),
(500,3000,100,100),
(0,1500,50,580),
(0,1400,900,100),
(50,1500,100,580),
(50,1400,850,100),
(200,1250,70,50), #[4]
(300,750,200,50),
(850,650,400,50),
Expand Down Expand Up @@ -290,11 +279,11 @@
# y = 8070 - x
# schräge.append((x,y,1,20))
# x += 3
w4_blockkoordinaten = [(150,7750,400,250),
w4_blockkoordinaten = [(200,7750,400,250),
(700,7750,300,250),
(0,6700,100,1300),
(100,7750,50,250), #3
(100,100,100,100),
(50,6700,100,1300),
(150,7750,50,250), #3
(150,100,100,100),
(1200,7750,50,50),
(1200,7500,50,50),
(1500,7750,50,50),
Expand Down
21 changes: 19 additions & 2 deletions MASTER.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
survival_time = 0
score = 0
opponentscore = 0
test_startlvl = 2# Für Testen
test_startlvl = 5# Für Testen
hitpoints = 5
death_counter = 0
dead_show = 0
Expand Down Expand Up @@ -219,9 +219,10 @@ def update(self):
ex = Explotion(i.body)
i.dead = True
space.remove(i.body, i.shape)

global kill_counter
kill_counter += 15


if rect.colliderect(i.center_rect()):
LEVELSURF.blit(i.current_sprite(), i.center_rect())
random_int = random.randint(0,800)
Expand All @@ -231,6 +232,17 @@ def update(self):
k = Kugel((1200 * i.direction, -50),((245,12,188)), i.body.position.x + (15 * i.direction), i.body.position.y - 10, False)
k.shape.collision_type = 3
k.shape.sprite_group = 2
if i.endgegner:
k1 = Kugel((-1000, 500),((245,12,188)), i.body.position.x - 20, i.body.position.y +30, False)
k2 = Kugel((0, 500),((245,12,188)), i.body.position.x, i.body.position.y +30, False)
k3 = Kugel((1000, 500),((245,12,188)), i.body.position.x + 20, i.body.position.y +30, False)
k1.shape.collision_type = 3
k1.shape.sprite_group = 2
k2.shape.collision_type = 3
k2.shape.sprite_group = 2
k3.shape.collision_type = 3
k3.shape.sprite_group = 2
######################################%%%%%%%%%%%%%%%%%%%%%%%
i.update()

for i in self.power_ups:
Expand Down Expand Up @@ -427,6 +439,11 @@ def kugel_hits_gegner(space, arbiter):
for i in current_level.hindernisse:
if i.body == arbiter.shapes[0].body:
i.hitpoints -= 1
if i.endgegner: ####################################MAAAAAAAAAAAAAAAAAAAAAARRRRRRRRRRRRRIIIIIIIIIIIIIIIUUUUUUUUUUUUUUUUSSSSSSSSSSSSSSSSSs
j = pymunk.Body()
j.position = i.body.position
j.position.y -= 40
ex = Explotion(j)
return True

def kugel_hits_fliegender_gegner(space, arbiter):
Expand Down
Binary file modified Mastermind/__pycache__/__init__.cpython-32.pyc
Binary file not shown.
Binary file modified Mastermind/__pycache__/_mm_client.cpython-32.pyc
Binary file not shown.
Binary file modified Mastermind/__pycache__/_mm_constants.cpython-32.pyc
Binary file not shown.
Binary file modified Mastermind/__pycache__/_mm_errors.cpython-32.pyc
Binary file not shown.
Binary file modified Mastermind/__pycache__/_mm_netutil.cpython-32.pyc
Binary file not shown.
Binary file modified Mastermind/__pycache__/_mm_server.cpython-32.pyc
Binary file not shown.
7 changes: 4 additions & 3 deletions Startmenu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pygame,time, sys, MASTER, Gameclient,Gameserver,Texts, random#MASTERmulit,
import pygame,time, sys, MASTER, Gameclient,Gameserver,Texts, random
import fileinput # Für Highscore
from Startmenu_Images import *
from pygame.locals import *
Expand Down Expand Up @@ -27,15 +27,15 @@

WINDOWw = 800 #window width
WINDOWh = 600 #window height

clock = pygame.time.Clock()
buttonDistance = 50
buttonWidth = int(WINDOWh/4)
buttonHeight = int(buttonWidth / 2)

firstButtonXpos = WINDOWw/2 - buttonWidth - buttonDistance/2
firstButtonYpos = WINDOWh/3

levelcodes = ["","","heartattack","Not available","Unavailable","stonepower","None ;)"]
levelcodes = ["","","heartattack","randomness","unavailable","stonepower","None ;)"]

def music_change(new_music):
pygame.mixer.music.stop()
Expand Down Expand Up @@ -708,6 +708,7 @@ def interlevel_scene(self, level = 0):


while alpha_value < 255:
clock.tick(42)
self.display_surf.fill((0,0,0))
self.display_surf.blit(thisPrint,thisRect)
if line[1] != None:
Expand Down
4 changes: 2 additions & 2 deletions Texts.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
("'So you have seen him'",None),
("'Seen whom?', you reply",None),
("'The Being that brought you here..'",None),
("'Well, I didn't, really, just some shades.. a figure!'",None),
("'Well, I didn't, really, just some shades.. a figure!'","Gui/shadow.jpg"),
("'He doesn't want people to know what he looks like..'",None),
("Just as the shadow appeared, it vanished again",None),
("This time it seems to be a vulcanic planet","Gui/bg3.jpg"),
("'A perfect place for a villian to hide', you think",None),
("You scream as you fall hard on the dusky ground",)]
("You scream as you fall hard on the dusky ground",None)]

level_2_texts = [normal_level_2]

Expand Down
Binary file modified __pycache__/Boden.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Gameclient.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Gameserver.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Hindernis.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Level.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/MASTER.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Power_Ups.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Speicherpunkt.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/SpriteSheet.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Startmenu_Images.cpython-32.pyc
Binary file not shown.
Binary file modified __pycache__/Texts.cpython-32.pyc
Binary file not shown.

0 comments on commit af36e2f

Please sign in to comment.