- changed status to resolved
Image files do not have physics
Using an imported png file with window in physics mode. The png file has no physics. See sample code below:
from Graphics import *
win=Window(500,500) win.mode="physics"
rectangle = Rectangle((0,400),(500,500)) rectangle.draw(win) rectangle.bodyType="static"
monkey=makePicture("monkey.png") monkey.draw(win)
circle=Circle((250,250),20) circle.fill=Color("blue") circle.draw(win)
while True: if getKeyPressed("Right"): monkey.move(5,0) if getKeyPressed("Left"): monkey.move(-5,0) if getKeyPressed("Up"): monkey.move(0,-5) if getKeyPressed("Down"): monkey.move(0,5) win.step()
Comments (3)
-
-
Fixed issue
#217: added Physics to Image; new example→ <<cset 12e5f40f5da5>>
-
Fixed: see also better example here of how to mix Physics and keypress movements (eg, add Forces).
- Log in to comment
Fixed issue
#217: added Physics to Image; new example→ <<cset 37a0bfc3f855>>