Skip to content
Permalink
Browse files

Added cloud class

  • Loading branch information
MysteryCoder456 committed Mar 26, 2020
1 parent 70b7af4 commit 73c23fbff1997dac76b95a5e69d15cb0dc020eb9
Showing with 15 additions and 0 deletions.
  1. +1 −0 game/constants.py
  2. +12 −0 game/entities/cloud.py
  3. +2 −0 game/states/game.py
@@ -20,6 +20,7 @@
CROSSHAIR_IMAGE_PATH = "crosshair.png"
CROSSHAIR_GREEN_IMAGE_PATH = "crosshair_green.png"
BULLET_IMAGE_PATH = "bullet.png"
CLOUD_IMAGE_PATH = "cloud.png"

ORANGE = (255, 165, 0)
GREEN = (141, 178, 85)
@@ -0,0 +1,12 @@
from game.base.entity import Entity
from game.constants import SPRITES_DIR, CLOUD_IMAGE_PATH, SHIP_IMAGE_PATH
from glm import vec3
from random import randint
import os


class Cloud(Entity):
def __init__(self, app, scene, player):
pos = vec3(0, 200, -5000)
vel = vec3(randint(-15, 15), 0, player.velocity.z)
super().__init__(app, scene, SHIP_IMAGE_PATH, position=pos, velocity=vel)
@@ -8,6 +8,7 @@
from game.entities.camera import Camera
from game.entities.ground import Ground
from game.entities.player import Player
from game.entities.cloud import Cloud
from game.entities.terminal import Terminal
from game.scene import Scene
from game.scripts.level1 import Level1
@@ -28,6 +29,7 @@ def __init__(self, app, state=None):
self.camera = self.scene.add(Camera(app, self.scene, self.app.size))
self.scene.add(Ground(app, self.scene, GROUND_HEIGHT))
self.player = self.scene.add(Player(app, self.scene))
self.cloud = self.scene.add(Cloud(app, self.scene, self.player))
# self.msg = self.scene.add(Message(self.app, self.scene, "HELLO"))

self.scene.script = Level1

0 comments on commit 73c23fb

Please sign in to comment.
You can’t perform that action at this time.