96px Games
> Hardware
> Software
> Demo
Lasercut Matrix Panel
WS2812
ESP8266
PixelPi
Python based Driver
(for example for Raspberry Pi)
http://j.mp/pixelPi
OctoESP
ESP8266 driver
http://j.mp/OctoEsp
96Pixel Games
Game SDK
http://j.mp/96pxGames
Color
Animation
Audio
Game
Initialization
class SampleGame(Game):
def __init__(self, ip):
Game.__init__(self, ip, [
Sound('tock', 'sounds/tock.wav')
],[{
"name": 'slow',
"file": 'music/slow.ogg'
}], [
MainState()
])
self.setState('Main')
self.music.play('slow')
class MainState(State):
def __init__(self):
State.__init__(self, "Main")
sample = SampleGame("127.0.0.1")
sample.run()
Execute
Nothing exciting yet
Add some Players
class MainState(State):
def __init__(self):
State.__init__(self, "Main")
w = PIXEL_DIM_X - 1
h = PIXEL_DIM_Y - 1
self.characters = [
AnimatedGameObject(Vector(0, 0), RED),
AnimatedGameObject(Vector(w, 0), BLUE),
AnimatedGameObject(Vector(0, h), GREEN),
AnimatedGameObject(Vector(w, h), YELLOW)
]
Update
class MainState(State):
...
def update(self, dt):
Game.update(self, dt)
for character in self.characters:
character.update(dt)
def draw(self, rgb):
Game.draw(self, rgb)
for character in self.characters:
character.draw(rgb)
Draw
Move and Make noise
class MainState(State):
...
def onAxisChanged(self, player, x, y, px, py):
State.onAxisChanged(self, player, x, y, px, py)
self.characters[player].velocity = Vector(x, y)
self.game.playSound('tock')
Demo
Thanks
Let's Build some Games!
96 Pixel Party
By Sven Hecht
96 Pixel Party
- 529