Image files do not have physics

Issue #217 resolved
Laura Blankenship created an issue

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)

  1. Doug Blank

    Fixed: see also better example here of how to mix Physics and keypress movements (eg, add Forces).

  2. Log in to comment