Skip to content

Instantly share code, notes, and snippets.

View SpaceVoyager's full-sized avatar

Yuhang Wang SpaceVoyager

View GitHub Profile
@SpaceVoyager
SpaceVoyager / superalien.py
Created August 6, 2016 18:07
superalien.py
# coding: utf-8
from scene import *
import json
import sound
A = Action
standing_texture = Texture('plf:AlienBlue_front')
walk_textures = [Texture('plf:AlienBlue_walk1'), Texture('plf:AlienBlue_walk2')]
jump_texture = Texture('plf:AlienBlue_jump')
@SpaceVoyager
SpaceVoyager / superalien.py
Created July 16, 2016 19:27
superalien.py
# coding: utf-8
from scene import *
import json
import sound
A = Action
standing_texture = Texture('plf:AlienBlue_front')
walk_textures = [Texture('plf:AlienBlue_walk1'), Texture('plf:AlienBlue_walk2')]
jump_texture = Texture('plf:AlienBlue_jump')
@SpaceVoyager
SpaceVoyager / superalien.py
Created July 9, 2016 17:57
superalien.py
# coding: utf-8
from scene import *
import json
import sound
A = Action
standing_texture = Texture('plf:AlienBlue_front')
walk_textures = [Texture('plf:AlienBlue_walk1'), Texture('plf:AlienBlue_walk2')]
jump_texture = Texture('plf:AlienBlue_jump')
@SpaceVoyager
SpaceVoyager / Tutorial Part 7.py
Created July 9, 2016 17:55
Tutorial Part 7.py
# coding: utf-8
'''
Part 7 -- Space Lasers! ✳️
The whole game has been somewhat defensive so far, so let's give the little alien something to attack -- lasers!
When a laser hits a meteor, it should be destroyed in an explosion, and as additional motivation to shoot them down, a destroyed meteor leaves behind a valuable star coin to collect.
A laser is shot when you tap anywhere on the screen, by implementing the `touch_began()` method. A maximum of 3 lasers can be on the screen at once; maybe the laser gun needs recharging -- in any case, it's supposed to discourage simply hammering on the screen the entire time.
@SpaceVoyager
SpaceVoyager / superalien.py
Created July 2, 2016 20:38
superalien.py
# coding: utf-8
from scene import *
import json
import sound
A = Action
standing_texture = Texture('plf:AlienBlue_front')
walk_textures = [Texture('plf:AlienBlue_walk1'), Texture('plf:AlienBlue_walk2')]
jump_texture = Texture('plf:AlienBlue_jump')
@SpaceVoyager
SpaceVoyager / superalien.py
Created July 2, 2016 18:52
superalien.py
# coding: utf-8
from scene import *
import json
import sound
A = Action
standing_texture = Texture('plf:AlienBlue_front')
walk_textures = [Texture('plf:AlienBlue_walk1'), Texture('plf:AlienBlue_walk2')]
jump_texture = Texture('plf:AlienBlue_jump')
@SpaceVoyager
SpaceVoyager / superalien.py
Created July 2, 2016 13:00
superalien.py
# coding: utf-8
from scene import *
import json
import sound
A = Action
standing_texture = Texture('plf:AlienBlue_front')
walk_textures = [Texture('plf:AlienBlue_walk1'), Texture('plf:AlienBlue_walk2')]
jump_texture = Texture('plf:AlienBlue_jump')
@SpaceVoyager
SpaceVoyager / superalien.py
Created June 18, 2016 16:11
superalien.py
# coding: utf-8
from scene import *
import json
import sound
A = Action
standing_texture = Texture('plf:AlienBlue_front')
walk_textures = [Texture('plf:AlienBlue_walk1'), Texture('plf:AlienBlue_walk2')]
jump_texture = Texture('plf:AlienBlue_jump')
@SpaceVoyager
SpaceVoyager / blocksexample.py
Created May 21, 2016 19:32
blocksexample.py
from scene import *
import json
import sound
background_objects_json_str = '''
[{"x": 500, "y": 62, "w": 50, "h": 80, "img": "plc:Dirt_Block"},
{"x": 500, "y": 100, "w": 50, "h": 80, "img": "plc:Dirt_Block"},
{"x": 500, "y": 150, "w": 50, "h": 50, "img": "plc:Grass_Block"}]
'''
@SpaceVoyager
SpaceVoyager / blocksexample.py
Created May 21, 2016 19:15
blocksexample.py
from scene import *
import json
import sound
background_objects_json_str = '[{"x": 500, "y": 50, "w": 50, "h": 50, "img": "plc:Dirt_Block"}]'
class GameEnvironment(object):
def __init__(self):
self.background_speed = 0.3