|
1 | 1 | """ |
2 | 2 | Program Name: SRunner.py |
3 | 3 | Creator: James Ashwood |
4 | | -Date last modified: 7 Aug 2021 |
| 4 | +Date last modified: 8 Aug 2021 |
5 | 5 | Github Link: https://github.com/James-Ashwood/SRunner |
6 | 6 | """ |
7 | 7 |
|
|
11 | 11 |
|
12 | 12 | import arcade |
13 | 13 | from typing import Optional |
14 | | -import math |
15 | | -from time import sleep |
16 | 14 | import random |
17 | 15 |
|
18 | 16 | ## Constants |
@@ -180,11 +178,20 @@ def setup(self): |
180 | 178 |
|
181 | 179 | for x in range(250): |
182 | 180 | image_source6 ="code/resources/background.png" ## Background |
183 | | - self.bg_sprite = arcade.Sprite(image_source6, 2) |
184 | | - self.bg_sprite.center_x = x * 100 |
| 181 | + self.bg_sprite = arcade.Sprite(image_source6, 1.2) |
| 182 | + self.bg_sprite.center_x = x * 600 |
185 | 183 | self.bg_sprite.center_y = 250 |
186 | 184 | self.bg.append(self.bg_sprite) |
187 | 185 |
|
| 186 | + ## Start button |
| 187 | + |
| 188 | + self.start_list = arcade.SpriteList() |
| 189 | + image_source7 ="code/resources/startbutton.png" ## Block type 5 |
| 190 | + |
| 191 | + self.start_sprite = arcade.Sprite(image_source7, 1) |
| 192 | + self.start_sprite.center_x = 120 |
| 193 | + self.start_sprite.center_y = 130 |
| 194 | + self.start_list.append(self.start_sprite) |
188 | 195 |
|
189 | 196 | ### ~ Physics Engine Setup ~ ### |
190 | 197 |
|
@@ -224,6 +231,7 @@ def on_draw(self): |
224 | 231 | self.bridge_list.draw() |
225 | 232 |
|
226 | 233 | if GAME_STATUS == 2: |
| 234 | + self.start_list.draw() |
227 | 235 | arcade.draw_text("Game over, you score was " + str(SCORE), 20, 20, arcade.color.BLACK, 30) |
228 | 236 |
|
229 | 237 | def on_update(self, delta_time): |
@@ -293,7 +301,7 @@ def on_update(self, delta_time): |
293 | 301 |
|
294 | 302 | def on_key_press(self, key, modifiers): |
295 | 303 |
|
296 | | - global CUrRENT_BLOCK_TYPE |
| 304 | + global CURRENT_BLOCK_TYPE |
297 | 305 |
|
298 | 306 | ## Player jumps if the UP or W key is pressed |
299 | 307 |
|
|
0 commit comments