Skip to content

Commit

Permalink
start on level 3
Browse files Browse the repository at this point in the history
  • Loading branch information
gandalf3 committed Dec 27, 2015
1 parent fe768cf commit d7b99d0
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
5 changes: 3 additions & 2 deletions level_end.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import bge
from main import nextlevel
player = bge.logic.getCurrentScene().objects["player"]

def check_collision(object):
if object == player:
print(object)
if object == bge.logic.getCurrentScene().objects["player"]:
nextlevel()
print("hello?")

def main(cont):
own = cont.owner
Expand Down
6 changes: 3 additions & 3 deletions light_trail.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, own):
for i in range(self.segments):
self.past_locations.append(scene.objects[self.guide].worldPosition)
# for i in range(self.segments/2):
self.mesh_segments.append(LightTrailSegment(scene.addObject("trail_segment")))
# self.mesh_segments.append(LightTrailSegment(scene.addObject("trail_segment")))

self.tick_count=0

Expand All @@ -39,7 +39,7 @@ def main(self):
self.tick_count = 0


for i in range(self.segments):
for i in reversed(range(self.segments)):
#self.mesh_segments[i].worldPosition = self.past_locations[i]
#self.mesh_segments[i].worldOrientation = (0, 0, 0)

Expand Down Expand Up @@ -67,7 +67,7 @@ def main(self):
bottom_left = e
bottom_right = f

bge.render.drawLine(self.past_locations[i], self.past_locations[i] - (self.past_locations[i] - self.past_locations[i-1]), (1,1,1))
bge.render.drawLine(self.past_locations[i], self.past_locations[i-1], (1,1,1))

verts = [top_right, top_left, bottom_left, bottom_right]

Expand Down
Binary file modified lonely_photon.blend
Binary file not shown.
21 changes: 10 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
import random
import utils

#sound = aud.Factory.file(logic.expandPath("//sound/Adventure Meme.mp3")).volume(.1).loop(-1)
#sound = aud.Factory.file(logic.expandPath("//sound/Unwritten Return.mp3")).volume(1).loop(-1)
sound = aud.Factory.file(logic.expandPath("//sound/Destiny Day.mp3")).volume(1).loop(-1)
sound = aud.Factory.file(logic.expandPath("//sound/Adventure Meme.mp3")).volume(.1).loop(-1)
#sound = aud.Factory.file(logic.expandPath("//sound/Unwritten Return.mp3")).volume(.5).loop(-1)
#sound = aud.Factory.file(logic.expandPath("//sound/Destiny Day.mp3")).volume(.5).loop(-1)
music = aud.device().play(sound)

dict = logic.globalDict
playername = "player"
scene = logic.getCurrentScene()

levels = ['level1', 'level2']
levels = ['level1', 'level2', 'level3']
dict["current_level"] = 0

class Sentry(types.KX_GameObject):
Expand All @@ -24,13 +24,11 @@ def __init__(self, own):

self.target = logic.getCurrentScene().objects[playername]

self.fireRate = .1
self.range = 20
self.fireRate = self.get("fireRate", .1)
self.range = self.get("range", 20)
self.projectile_speed = 1 # multiplier for default projectile speed

if not self.get("projectile", 0):
self.projectile_type = "standard_projectile"
else:
self.projectile_type = self["projectile"]
self.projectile_type = self.get("projectile", "standard_projectile")

print(self.name, "using", self.projectile_type)

Expand Down Expand Up @@ -70,6 +68,7 @@ def fire(self):

projectile = logic.getCurrentScene().addObject(self.projectile_type, self.firepoint, 0)
projectile.worldOrientation = self.worldOrientation
# projectile.speed = projectile.speed * self.projectile_speed

for part in self.mparts:
part.playAction(name="sentry", start_frame=1, end_frame=4)
Expand All @@ -95,7 +94,7 @@ def __init__(self, own, sound):

self.sound = sound

self.speed = -30
self.speed = self.get("speed", 30)*-1
self.homing_factor = 0

self.collisionCallbacks.append(self.on_collision)
Expand Down
Binary file added sound/Music for Manatees.mp3
Binary file not shown.
Binary file added sound/distant_explosion.wav
Binary file not shown.
Binary file added sound/distant_explosion_mono.wav
Binary file not shown.

0 comments on commit d7b99d0

Please sign in to comment.