~jlhancock/tygger/tygger-dev

« back to all changes in this revision

Viewing changes to test.py

  • Committer: jhancock
  • Date: 2007-07-17 04:13:40 UTC
  • Revision ID: jhancock@ubuntu-20070717041340-pgi0a8qv09lvolf1
made good progress in applying force to an object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from vectors import vec2d
2
 
 
 
1
from tygger import *
 
2
 
 
3
pygame.init()
 
4
 
 
5
t = Timer(5)
 
6
 
 
7
#count = 7
 
8
#while count > 0:
 
9
#    print t.start, t.end, pygame.time.get_ticks()/1000.0, t.done
 
10
#    time.sleep(.5)
 
11
#    count -= 1
 
12
 
 
13
 
 
14
 
 
15
begin_graphics()
 
16
 
 
17
c = NewCircle((50,50), 10)
 
18
top = Wall((640/2, 475), 640, 5)
 
19
apply_force(c, vec2d(5,2), 5)
 
20
count = 100
 
21
while count >= 0:
 
22
    if top.center.y <= c.center.y:
 
23
        pass
 
24
     #   collision(top, c)
 
25
 
 
26
    print "vel=", c.vel, "force=", c.force, "dis=", c.impulse_timer.end, pygame.time.get_ticks()/1000.0, c.impulse_timer.done
 
27
    move_by(c, c.dis().x, c.dis().y)
 
28
    count -= 1
 
29
    time.sleep(.05)
 
30
print "done"
 
31
raw_input()
 
32
end_graphics()
3
33
 
4
34
 
5
35