pong - grafika ship
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
import pgzrun
|
import pgzrun
|
||||||
|
from random import randint
|
||||||
|
|
||||||
# Start programu
|
# Start programu
|
||||||
WIDTH = 1000
|
WIDTH = 1000
|
||||||
HEIGHT = 676
|
HEIGHT = 676
|
||||||
@@ -9,6 +11,8 @@ sprite = Actor("ball.png")
|
|||||||
ship = Actor("ship.png")
|
ship = Actor("ship.png")
|
||||||
sprite.x = WIDTH//2
|
sprite.x = WIDTH//2
|
||||||
sprite.y = HEIGHT//2
|
sprite.y = HEIGHT//2
|
||||||
|
ship.x = randint(20,WIDTH-20)
|
||||||
|
ship.y = randint(20,HEIGHT-20)
|
||||||
|
|
||||||
# Najważniejsze funkcje sterujące
|
# Najważniejsze funkcje sterujące
|
||||||
def update():
|
def update():
|
||||||
@@ -33,6 +37,7 @@ def update():
|
|||||||
|
|
||||||
def draw():
|
def draw():
|
||||||
screen.blit("tomulus64.jpg", (0,0) )
|
screen.blit("tomulus64.jpg", (0,0) )
|
||||||
|
ship.draw()
|
||||||
sprite.draw()
|
sprite.draw()
|
||||||
|
|
||||||
pgzrun.go()
|
pgzrun.go()
|
||||||
Reference in New Issue
Block a user