-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finally (somewhat) working demo state
- Loading branch information
Showing
14 changed files
with
268 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
from bge import logic | ||
|
||
scene = logic.getCurrentScene() | ||
player = scene.objects["player"] | ||
dict = logic.globalDict | ||
player = dict['player'] | ||
|
||
def main(controller): | ||
own = controller.owner | ||
|
||
|
||
own.worldPosition.x += (player.worldPosition.x - own.worldPosition.x) * .1 | ||
own.worldPosition.y += (player.worldPosition.y - own.worldPosition.y) * .1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from main import Projectile | ||
from bge import logic | ||
import random | ||
import aud | ||
|
||
laser_sounds = [aud.Factory.file(logic.expandPath("//sound/laser/laserfire01_mono.wav")).volume(.5).fadeout(0, .4), aud.Factory.file(logic.expandPath("//sound/laser/laserfire02_mono.wav")).volume(.5).fadeout(0, .4)] | ||
|
||
def main(cont): | ||
own = cont.owner | ||
|
||
if not "init" in own: | ||
own["init"] = True | ||
own = Projectile(own, sound=random.choice(laser_sounds)) | ||
|
||
own.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import bge | ||
from main import nextlevel | ||
player = bge.logic.globalDict['player'] | ||
|
||
def check_collision(object): | ||
if object == player: | ||
nextlevel() | ||
|
||
def main(cont): | ||
own = cont.owner | ||
|
||
own.collisionCallbacks.append(check_collision) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.