Month: August 2015

Virtual display – part 2: offsets

We have a simple virtual display. It can join lcds in one virtual area. But there is one catch. Look at the following layouts (red area is virtual lcd):

layout_leftlayout_center

No problem. But what about:

layout_right

… we can’t do it ! And what if we want to use this small 4×4 as second virtual display ? We can’t !

When we add lcd its added at any (x,y) but always starts from (0,0). Lets add an offset, so we can specify area.

Update – error in code. see at the bottom

Download source

(more…)

Virtual display – part 1

We have a fully functional game that is quite primitive but don’t wory. We will do something about it and during this we will upgrade Lcd classes.

Remember draw function in game.py ? It was doing all kind of checks and distinctions between lcds. It shouldn’t be like that. Game class shouldn’t care about proper display, such task goes to lower level of code. From game perspective it should have some area to display and thats all. It should write on any (x, y) allowed by combined displays and don’t care which display is top, bottom, left or right.

Its time for Virtual Display 🙂

Download source

(more…)

Piader – simple game – part 3

Today we will add player and it’s controls.

Controls, that’s something we will do a different way, we have no keyboard attached, no joystick and no pad. So what now ? Lets write a control server, a threaded class that will listen for control signals on some port. This way we will be able to use anything to move a player.

As first input we will use host keyboard, small class that will read keys and send them to game.

Download source code

(more…)