Just to make myself clearer, what i mean by jiggle is that it rapidly goes
forward than backward than forward again and so on.
And something else that is weird is that the output okay:
---------
own
speed = 1.0 x = 1.0
speed = 2.0 x = 3.0
speed = 3.0 x = 6.0
speed = 4.0 x = 10.0
speed = 5.0 x = 15.0
speed = 6.0 x = 21.0
speed = 7.0 x = 28.0
speed = 8.0 x = 36.0
release
speed = 7.2 x = 43.2
speed = 6.48 x = 49.68
speed = 5.832 x = 55.512
speed = 5.2488 x = 60.7608
speed = 4.72392 x = 65.48472
speed = 4.251528 x = 69.736248
speed = 3.8263752 x = 73.5626232
speed = 3.44373768 x = 77.00636088
speed = 3.099363912 x = 80.105724792
speed = 2.7894275208 x = 82.8951523128
speed = 2.51048476872 x = 85.4056370815
speed = 2.25943629185 x = 87.6650733734
speed = 2.03349266266 x = 89.698566036
speed = 1.8301433964 x = 91.5287094324
speed = 1.64712905676 x = 93.1758384892
speed = 1.48241615108 x = 94.6582546403
speed = 1.33417453597 x = 95.9924291762
speed = 1.20075708238 x = 97.1931862586
speed = 1.08068137414 x = 98.2738676328
speed = 0.972613236725 x = 99.2464808695
speed = 0.875351913052 x = 100.121832783
speed = 0.787816721747 x = 100.909649504
speed = 0.709035049572 x = 101.618684554
speed = 0.638131544615 x = 102.256816098
speed = 0.574318390153 x = 102.831134489
speed = 0.516886551138 x = 103.34802104
speed = 0.465197896024 x = 103.813218936
speed = 0.418678106422 x = 104.231897042
speed = 0.37681029578 x = 104.608707338
speed = 0.339129266202 x = 104.947836604
speed = 0.305216339582 x = 105.253052944
speed = 0.274694705623 x = 105.527747649
speed = 0.247225235061 x = 105.774972884
speed = 0.222502711555 x = 105.997475596
speed = 0.200252440399 x = 106.197728036
speed = 0.18022719636 x = 106.377955233
speed = 0.162204476724 x = 106.540159709
speed = 0.145984029051 x = 106.686143739
speed = 0.131385626146 x = 106.817529365
speed = 0.118247063531 x = 106.935776428
speed = 0.106422357178 x = 107.042198785
speed = 0.0957801214605 x = 107.137978907
speed = 0.0862021093144 x = 107.224181016
speed = 0.077581898383 x = 107.301762915
speed = 0.0698237085447 x = 107.371586623
speed = 0.0628413376902 x = 107.434427961
speed = 0.0565572039212 x = 107.490985165
speed = 0.0509014835291 x = 107.541886648
speed = 0.0458113351762 x = 107.587697983
-------
I hope you can help me!
On Sun, Dec 7, 2008 at 3:57 PM, Philippe <[EMAIL PROTECTED]> wrote:
> Hi, I'm new to python and pyglet. I'm trying to make an brick like
> game but there's a bug that makes the paddle jiggle.
>
> here's my code:
> import pyglet
> from pyglet.window import key
>
> window = pyglet.window.Window()
> #window.push_handlers(pyglet.window.event.WindowEventLogger())
> barre = pyglet.resource.image("barre.png")
> balle = pyglet.resource.image("balle.png")
> xBarre = 0
> speedBarre = 0
> downR = 0
>
> @window.event
> def on_key_press(symbol, modifiers):
> global downR
> if symbol == key.RIGHT:
> downR = 1
> print "down"
>
> @window.event
> def on_key_release(symbol, modifiers):
> global downR
> if symbol == key.RIGHT:
> downR = 0
> print "release"
>
> def update(dt):
> global xBarre
> global speedBarre
> global downR
> if downR == 1:
> speedBarre += 1
> else:
> speedBarre *= 0.9
> xBarre += speedBarre
> print "speed = ", speedBarre, " x = ", xBarre
> window.clear()
> barre.blit(xBarre,0)
> balle.blit(100, 100)
> pyglet.clock.schedule_interval(update, 0.1)
>
> pyglet.app.run()
>
> -------------------------------------------------
> you can also download the file here: http://drop.io/brickvaders
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---