Beispiel #1
0
myshape.position(0.0, 0.0, 5)
myshape.set_draw_details(shader, [shapeimg, shapebump, shapeshine], 1.0, 0.1)
myshape.set_material((1.0, 0.5, 0.2, 0.5))

mywater = Plane(w=130.0, h=130.0)
mywater.set_draw_details(matsh, [waterbump[0], shapeshine], 12.0, 0.6)
mywater.set_material((0.0, 0.05, 0.1))
mywater.set_fog((0.4, 0.6, 0.8, 0.0),150)
mywater.rotateToX(90.001)
mywater.position(0.0, -2.0, 0.0)

arialFont = Ttffont("fonts/FreeMonoBoldOblique.ttf", "#dd00aa")   #load ttf font and set the font colour to 'raspberry'
mystring = String(font=arialFont, string="Now the Raspberry Pi really does rock")
mystring.translate(0.0, 0.0, 1)
mystring.set_shader(flatsh)

tick = 0
av_fps = 0
i_n=0
spf = 0.1 # seconds per frame, i.e. water image change
next_time = time.time() + spf
dx = 0.02
offset = 0.0 # uv offset
do = -0.001 # uv increment

# Fetch key presses.
mykeys = Keyboard()
fr = 0
# Display scene and rotate shape
while DISPLAY.loop_running():
Beispiel #2
0
myshape.set_material((1.0, 0.5, 0.2, 0.5))

mywater = Plane(w=130.0, h=130.0)
mywater.set_draw_details(matsh, [waterbump[0], shapeshine], 12.0, 0.6)
mywater.set_material((0.0, 0.05, 0.1))
mywater.set_fog((0.4, 0.6, 0.8, 0.0), 150)
mywater.rotateToX(90.001)
mywater.position(0.0, -2.0, 0.0)

arialFont = Ttffont(
    "fonts/FreeMonoBoldOblique.ttf",
    "#dd00aa")  #load ttf font and set the font colour to 'raspberry'
mystring = String(font=arialFont,
                  string="Now the Raspberry Pi really does rock")
mystring.translate(0.0, 0.0, 1)
mystring.set_shader(flatsh)

tick = 0
av_fps = 0
i_n = 0
spf = 0.1  # seconds per frame, i.e. water image change
next_time = time.time() + spf
dx = 0.02
offset = 0.0  # uv offset
do = -0.001  # uv increment

# Fetch key presses.
mykeys = Keyboard()
fr = 0
# Display scene and rotate shape
while DISPLAY.loop_running():
Beispiel #3
0
#avatar camera
avhgt = 2.0
xm = 0.0
zm = 0.0
ym = 0.0
lastX0 = 0.0
lastZ0 = 0.0
camera.position((xm, 2 + ym, -maphalf - 2.5))

arialFont = Font(
    "AR_CENA",
    "#dd00aa")  #load AR_CENA font and set the font colour to 'raspberry'
score = [0, 0]
score0 = String(camera, light, arialFont, str(score[0]), 0, 12, 0, 0.05, 0.05)
score0.set_shader(flatsh)
score1 = String(camera, light, arialFont, str(score[1]), 0, 12, 0, 0.05, 0.05)
score1.set_shader(flatsh)

#sphere loc and speed
sx, sy, sz = 0, 5, 0
dsx, dsy, dsz = 0.2, 0.0, -0.1
gravity = 0.02
#monster loc and speed
rx, ry, rz = 0, 0, -maphalf
drx, dry, drz = 0, 0, 0
max_speed = 0.2

# Fetch key presses
mykeys = Keyboard()
mymouse = Mouse(restrict=False)
Beispiel #4
0
                     divx=32, divy=32, ntiles=4, name="sub")
mymap.buf[0].set_draw_details(shader, [groundimg, groundimg, ballimg], 1.0, 0.0)

#avatar camera
avhgt = 2.0
xm = 0.0
zm = 0.0
ym = 0.0
lastX0 = 0.0
lastZ0 = 0.0
camera.position((xm, 2 + ym, -maphalf - 2.5))

arialFont = Font("AR_CENA","#dd00aa")   #load AR_CENA font and set the font colour to 'raspberry'
score = [0,0]
score0 = String(camera, light,  arialFont, str(score[0]), 0, 12, 0, 0.05, 0.05)
score0.set_shader(flatsh)
score1 = String(camera, light,  arialFont, str(score[1]), 0, 12, 0, 0.05, 0.05)
score1.set_shader(flatsh)

#sphere loc and speed
sx, sy, sz = 0, 5, 0
dsx, dsy, dsz = 0.2, 0.0, -0.1
gravity = 0.02
#monster loc and speed
rx, ry, rz = 0, 0, -maphalf
drx, dry, drz = 0, 0, 0
max_speed = 0.2

# Fetch key presses
mykeys = Keyboard()
mymouse = Mouse(restrict=False)