forked from 20241144010013/20241144010013
Adicionar modo debug
This commit is contained in:
parent
26645d8d0b
commit
e2fb482e4e
19
src/main.py
19
src/main.py
|
@ -1,6 +1,16 @@
|
|||
#setup
|
||||
import turtle as tl
|
||||
import random
|
||||
import random, sys
|
||||
|
||||
args = sys.argv
|
||||
# name, -arguments
|
||||
def has_argument(args, arg):
|
||||
if len(args) > 1:
|
||||
if args[1].startswith("-"):
|
||||
for chr in args[1]:
|
||||
if chr == arg:
|
||||
return True
|
||||
return False
|
||||
|
||||
posx = [0, 1, 2, 3, 4]
|
||||
posy = [0, 1, 2, 3, 4]
|
||||
|
@ -58,9 +68,12 @@ enemies = []
|
|||
|
||||
for i in range(AMOUNT_OF_ENEMIES):
|
||||
enemy = tl.Turtle()
|
||||
enemy.up()
|
||||
enemy.hideturtle()
|
||||
enemy.color("red")
|
||||
enemy.up()
|
||||
if not has_argument(args, "D"):
|
||||
enemy.hideturtle()
|
||||
else:
|
||||
enemy.shapesize(3, 3)
|
||||
pos = [random.choice(posy), random.choice(posy)]
|
||||
enemy.goto((pos[0] - 2) * 100, (pos[1] - 2) * 100)
|
||||
|
||||
|
|
Loading…
Reference in New Issue