fix level 2, add level 3, start + end cards

This commit is contained in:
Lephenixnoir 2023-11-02 21:49:39 +01:00
parent c666a584d6
commit 17963b116c
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 44 additions and 5 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/gg_data.py
/screenshots

24
gg.py
View File

@ -106,7 +106,7 @@ def collision(num, ox, oy, nx, ny, flipped):
def playLevel(num):
loadLevel(num)
x, y, vy, ay = 5, 90, 0, 1
x, y, vy, ay = 5, 16*[6,9,4][num], 0-(num==2), 1-2*(num==2)
frame = 0
action = False
standing = False
@ -132,7 +132,28 @@ def playLevel(num):
except KeyboardInterrupt:
action = standing
def startcard():
clear_screen()
draw_string(152, 20, "Gravity Guy !", (0,0,0), "small")
draw_string(15, 40, "Inversez la sens de gravitation en appuyant sur la", (0,0,0), "small")
draw_string(15, 55, "touche [AC/ON] pour sauter de plateforme en", (0,0,0), "small")
draw_string(15, 70, "platforme et atteindre la fin de chaque niveau.", (0,0,0), "small")
draw_string(15, 90, "[AC/ON]: C'est parti !", (0,0,0), "small")
show_screen()
try:
while True:
pass
except KeyboardInterrupt:
pass
def endcard():
clear_screen()
draw_string(136, 84, "Bravo Gravity Guy!", (0,0,0), "small")
show_screen()
def main():
startcard()
num = 0
while True:
b = playLevel(num)
@ -143,6 +164,7 @@ def main():
break
elif num+1 == len(levels):
print("Bravo!")
endcard()
break
else:
print("Niveau suivant?")

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="24" height="12" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="24" height="12" tilewidth="16" tileheight="16" infinite="0" nextlayerid="4" nextobjectid="1">
<tileset firstgid="1" source="tileset.tsx"/>
<layer id="1" name="Tile Layer 1" width="24" height="12" visible="0">
<data encoding="csv">
@ -17,10 +17,10 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,3,3,4,3,3,4
</data>
</layer>
<layer id="2" name="Tile Layer 2" width="24" height="12">
<layer id="2" name="Tile Layer 2" width="24" height="12" visible="0">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2,2,0,0,2,2,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,6,6,5,6,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -30,7 +30,23 @@
0,0,0,0,0,2,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4,3,3,3,4,3,3,3,4,3,3,3,4,3,3,3,4,0,0,0,0,0,0,0
4,3,3,3,4,3,3,3,4,3,3,3,4,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="3" name="Tile Layer 3" width="24" height="12">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,2,2,2,2,0,2,0,5,6,6,5,0,0,0,0,
5,6,6,6,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,
0,0,0,0,0,2,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,
4,3,4,3,4,3,4,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,4,3,4,3,4,3
</data>
</layer>
</map>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB