workin on adding score
This commit is contained in:
parent
82ef977e53
commit
793d3025db
2
Alien.py
2
Alien.py
@ -39,6 +39,8 @@ class Alien(arcade.Sprite):
|
|||||||
|
|
||||||
self.alien_sprite = arcade.Sprite(self.image_source, self.scScale)
|
self.alien_sprite = arcade.Sprite(self.image_source, self.scScale)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def update(self, x, sign, movedown):
|
def update(self, x, sign, movedown):
|
||||||
|
|
||||||
if self.alienType == "LA" and self.wait > 0:
|
if self.alienType == "LA" and self.wait > 0:
|
||||||
|
4
Main.py
4
Main.py
@ -2,6 +2,7 @@ import random
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import arcade
|
import arcade
|
||||||
|
import Score
|
||||||
|
|
||||||
from Bullet import Bullet
|
from Bullet import Bullet
|
||||||
from Alien import Alien
|
from Alien import Alien
|
||||||
@ -76,6 +77,7 @@ class MyGame(arcade.Window):
|
|||||||
self.rend = 0
|
self.rend = 0
|
||||||
self.lives = 3
|
self.lives = 3
|
||||||
self.level = 0
|
self.level = 0
|
||||||
|
self.score = None
|
||||||
# self.overlay_color = (0,255,0,128)
|
# self.overlay_color = (0,255,0,128)
|
||||||
self.player_sprite_death = None
|
self.player_sprite_death = None
|
||||||
self.somethingalsi = True
|
self.somethingalsi = True
|
||||||
@ -135,6 +137,8 @@ class MyGame(arcade.Window):
|
|||||||
# aliena.update(None,None,None)
|
# aliena.update(None,None,None)
|
||||||
self.aliens[b][a] = aliena
|
self.aliens[b][a] = aliena
|
||||||
|
|
||||||
|
self.score = Score(SCREEN_SCALE,DEBUG)
|
||||||
|
|
||||||
def collisionCheck(self, x1, y1, x2, y2, rx, ry):
|
def collisionCheck(self, x1, y1, x2, y2, rx, ry):
|
||||||
if abs(x1 - x2) <= rx and abs(y1 - y2) <= ry:
|
if abs(x1 - x2) <= rx and abs(y1 - y2) <= ry:
|
||||||
return True
|
return True
|
||||||
|
7
Score.py
7
Score.py
@ -1,3 +1,5 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
import arcade
|
import arcade
|
||||||
|
|
||||||
class Score(arcade.Sprite):
|
class Score(arcade.Sprite):
|
||||||
@ -17,3 +19,8 @@ class Score(arcade.Sprite):
|
|||||||
return self.value
|
return self.value
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
|
valArr = []
|
||||||
|
for value in str(self.value):
|
||||||
|
valArr.append(value)
|
||||||
|
print(valArr)
|
||||||
|
sys.exit()
|
Loading…
Reference in New Issue
Block a user