diff --git a/images/apple.png b/images/apple.png new file mode 100644 index 0000000..bc600ae Binary files /dev/null and b/images/apple.png differ diff --git a/main.py b/main.py index a6bb85f..b200223 100644 --- a/main.py +++ b/main.py @@ -1,20 +1,23 @@ import pgzrun +import random WIDTH = 800 HEIGHT = 600 -ship = Actor('dead8') -ship.x = 370 -ship.y = 550 +apple = Actor("apple") +apple_x = WIDTH / 2 +apple_y = HEIGHT / 2 +apple.pos = (WIDTH / 2 , HEIGHT / 2) -def update(): - if keyboard.left: - ship.x = ship.x - 5 - if keyboard.right: - ship.x = ship.x + 5 +sword = Actor("sword") + +dinosuars = [] +corpses = [] def draw(): - screen.fill((80,0,70)) - ship.draw() + screen.fill((100,220,100)) + apple.draw() + -pgzrun.go() # Must be last line \ No newline at end of file + +pgzrun.go() \ No newline at end of file diff --git a/main1.py b/old_code/main.py similarity index 100% rename from main1.py rename to old_code/main.py diff --git a/old_code/main1.py b/old_code/main1.py new file mode 100644 index 0000000..a6bb85f --- /dev/null +++ b/old_code/main1.py @@ -0,0 +1,20 @@ +import pgzrun + +WIDTH = 800 +HEIGHT = 600 + +ship = Actor('dead8') +ship.x = 370 +ship.y = 550 + +def update(): + if keyboard.left: + ship.x = ship.x - 5 + if keyboard.right: + ship.x = ship.x + 5 + +def draw(): + screen.fill((80,0,70)) + ship.draw() + +pgzrun.go() # Must be last line \ No newline at end of file diff --git a/main_old.py b/old_code/main_old.py similarity index 100% rename from main_old.py rename to old_code/main_old.py