Beispiel #1
0
 def __init__(self, position):
     ball_asset = ImageAsset("images/orb-150545_640.png") #pull from repository
     ball = Sprite(ball_asset, (0, 400))
     ball.scale = 0.07
     # custom attributes
     ball.direction = 1
     ball.go = True
     # Sounds
     pew1_asset = SoundAsset("sounds/pew1.mp3")
     pew1 = Sound(pew1_asset)
     pop_asset = SoundAsset("sounds/reappear.mp3")
     pop = Sound(pop_asset)
     super().__init__(ball_asset, position)
Beispiel #2
0
black = Color(0, 1)

noline = LineStyle(0, black)

bg_asset = RectangleAsset(SCREEN_WIDTH, SCREEN_HEIGHT, noline, green)
bg = Sprite(bg_asset, (0,0))


# A ball! This is already in the ggame-tutorials repository
ball_asset = ImageAsset("images/orb-150545_640.png")
ball = Sprite(ball_asset, (0, 0))
# Original image is too big. Scale it to 1/10 its original size
ball.scale = 0.1
# custom attributes
ball.dir = 1
ball.go = True

#Sounds
pew1_asset = SoundAsset("sounds/pew1.mp3")
pew1 = Sound(pew1_asset)
pop_asset = SoundAsset("sounds/reappear.mp3")
pop = Sound(pop_asset)


def reverse(b):
    b.dir *= -1
    
    # Set up function for handling screen refresh
def step():
    if ball.go:
        ball.x += ball.dir
Beispiel #3
0
bg = Sprite(bg_asset, (0,0))

# Sounds
pew1_asset = SoundAsset("sounds/pew1.mp3")
pew1 = Sound(pew1_asset)
pop_asset = SoundAsset("sounds/reappear.mp3")
pop = Sound(pop_asset)
# A ball! This is already in the ggame-tutorials repository
ball_asset = ImageAsset("images/orb-150545_640.png")
ball = Sprite(ball_asset, (0, 0))
# Original image is too big. Scale it to 1/10 its original size
ball.scale = 0.1
ball.y = 200
# custom attributes
ball.dir = 1
ball.go = True
# Sounds
pew1_asset = SoundAsset("sounds/pew1.mp3")
pew1 = Sound(pew1_asset)
pop_asset = SoundAsset("sounds/reappear.mp3")
pop = Sound(pop_asset)


def reverse(b):
    b.dir *= -1
    pop.play()

# Set up function for handling screen refresh
def step():
    if ball.go:
        ball.x += ball.dir
Beispiel #4
0
noline = LineStyle(0, black)
bg_asset = RectangleAsset(SCREEN_WIDTH, SCREEN_HEIGHT, noline, brown)
cover_asset = RectangleAsset(600, 440, noline, green)
bg = Sprite(bg_asset, (0, 0))
cover = Sprite(cover_asset, (20, 20))

# A ball! This is already in the ggame-tutorials repository
ball_asset = ImageAsset("images/orb-150545_640.png")
beach_asset = ImageAsset("images/beach-ball-575425_640.png")
ball = Sprite(ball_asset, (0, 0))
beach = Sprite(beach_asset, (40, 40))
# Original image is too big. Scale it to 1/10 its original size
ball.scale = 0.1
# custom attributes
ball.dir = 1
ball.go = True
beach.scale = 0.1
beach.dir = 2
beach.go = True


def reverse(b):
    b.dir *= -1
    pop.play()


# Set up function for handling screen refresh
def step():
    if ball.go:
        ball.x += ball.dir
        if ball.x + ball.width > SCREEN_WIDTH or ball.x < 0:
Beispiel #5
0
    uno.append(Wall2((1287, 87 + x * 88)))
print(uno)
potato = Sprite(potato_asset, (300, 675))
potato.scale = .05
potato.fxcenter = potato.fycenter = 0.5
chips_asset = ImageAsset("images/dipsiedoodles.png", )
chips = Sprite(chips_asset, (1150, 100))
chips.scale = .2
# Movement
sun_asset = ImageAsset("images/sun.png", )
sun = Sprite(sun_asset, (1150, 500))
#sun.scale=.5
sun.center = .5
spaceship.dir = 3
spaceship.bob = 3
spaceship.go = False
spaceship.ygo = False
spaceship.thrust = 0
spaceship.thrustframe = 1
background1.visible = True
background2.visible = False
castle.visible = False
potato.visible = True
factory.visible = False
sun.visible = False
background3.visible = False
chips.visible = False
winning = False
background4.visible = False
background5.visible = False
reset = False