Browse Source

add minigame features

Nabzzz 7 months ago
parent
commit
da76a3c4b8
39 changed files with 643 additions and 26 deletions
  1. 14
    4
      mini-game/MiniGame.gd
  2. BIN
      mini-game/ressources/sprites/bonus/bonus_enveloppe.png
  3. 34
    0
      mini-game/ressources/sprites/bonus/bonus_enveloppe.png.import
  4. BIN
      mini-game/ressources/sprites/obstacle/malus_enveloppe.png
  5. 34
    0
      mini-game/ressources/sprites/obstacle/malus_enveloppe.png.import
  6. BIN
      mini-game/ressources/sprites/player/man/1.png
  7. 34
    0
      mini-game/ressources/sprites/player/man/1.png.import
  8. BIN
      mini-game/ressources/sprites/player/man/2.png
  9. 34
    0
      mini-game/ressources/sprites/player/man/2.png.import
  10. BIN
      mini-game/ressources/sprites/player/man/3.png
  11. 34
    0
      mini-game/ressources/sprites/player/man/3.png.import
  12. BIN
      mini-game/ressources/sprites/player/man/4.png
  13. 34
    0
      mini-game/ressources/sprites/player/man/4.png.import
  14. BIN
      mini-game/ressources/sprites/player/man/5.png
  15. 34
    0
      mini-game/ressources/sprites/player/man/5.png.import
  16. BIN
      mini-game/ressources/sprites/player/man/6.png
  17. 34
    0
      mini-game/ressources/sprites/player/man/6.png.import
  18. BIN
      mini-game/ressources/sprites/player/man/7.png
  19. 34
    0
      mini-game/ressources/sprites/player/man/7.png.import
  20. BIN
      mini-game/ressources/sprites/player/man/8.png
  21. 34
    0
      mini-game/ressources/sprites/player/man/8.png.import
  22. BIN
      mini-game/ressources/sprites/player/man/9_1.png
  23. 34
    0
      mini-game/ressources/sprites/player/man/9_1.png.import
  24. BIN
      mini-game/ressources/sprites/player/man/9_2.png
  25. 34
    0
      mini-game/ressources/sprites/player/man/9_2.png.import
  26. BIN
      mini-game/ressources/sprites/player/man/9_3.png
  27. 34
    0
      mini-game/ressources/sprites/player/man/9_3.png.import
  28. BIN
      mini-game/ressources/sprites/player/man/9_4.png
  29. 34
    0
      mini-game/ressources/sprites/player/man/9_4.png.import
  30. BIN
      mini-game/ressources/sprites/player/man/9_5.png
  31. 34
    0
      mini-game/ressources/sprites/player/man/9_5.png.import
  32. 24
    0
      mini-game/scenes/bonuses/bonus2.tscn
  33. 7
    2
      mini-game/scenes/decor/scoreUI.gd
  34. 26
    0
      mini-game/scenes/obstacles/obstacle2.tscn
  35. 25
    5
      mini-game/scenes/players/player2.tscn
  36. 4
    2
      mini-game/scenes/spawner/spawner.tscn
  37. 6
    4
      mini-game/scripts/player2.gd
  38. 24
    6
      mini-game/scripts/spawner.gd
  39. 3
    3
      scenes/Main.gd

+ 14
- 4
mini-game/MiniGame.gd View File

@@ -14,18 +14,28 @@ var next_timeline_lose := ""
14 14
 var next_timeline_win := ""
15 15
 
16 16
 var game_mode = ""
17
+var game_goal = 10
18
+var game_difficulty = "easy"
19
+var game_version = 0
17 20
 
18 21
 var MUSIC = "res://music/mini_jeu.ogg"
19 22
 
23
+
20 24
 func _ready():
21 25
 	Signals.connect("die", self, "on_game_over")
22 26
 	Signals.connect("win", self, "on_win")
23 27
 
24 28
 
25
-func setup(mode: String, next_lose: String, next_win: String):
29
+func setup(mode: String, goal: int, difficulty: String, next_lose: String, next_win: String, version: int):
30
+	game_goal = goal
31
+	if(difficulty == "hard"):
32
+		game_difficulty = "hard"
33
+	else:
34
+		game_difficulty = "easy"
35
+	game_version = version
26 36
 	print("minigame: " + mode + " " + next_lose + " " + next_win)
27 37
 	set_mode(mode)
28
-	scoreUI.init(mode)
38
+	scoreUI.init(mode, game_goal)
29 39
 	next_timeline_lose = next_lose
30 40
 	next_timeline_win = next_win
31 41
 
@@ -54,11 +64,11 @@ func start():
54 64
 	start_timer_UI.update_timer("GO !")
55 65
 	instructionsUI._init()
56 66
 	foreground.start()
57
-	player.start(game_mode)
67
+	player.start(game_mode, game_goal)
58 68
 	yield(t, "timeout")
59 69
 	yield(t, "timeout")
60 70
 	start_timer_UI.hide()
61
-	spawner.start()
71
+	spawner.start(game_difficulty, game_version)
62 72
 	scoreUI.start(game_mode)
63 73
 	t.queue_free()
64 74
 

BIN
mini-game/ressources/sprites/bonus/bonus_enveloppe.png View File


+ 34
- 0
mini-game/ressources/sprites/bonus/bonus_enveloppe.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/bonus_enveloppe.png-99ee6798e10ed7de038cee7885cc8217.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/bonus/bonus_enveloppe.png"
13
+dest_files=[ "res://.import/bonus_enveloppe.png-99ee6798e10ed7de038cee7885cc8217.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/obstacle/malus_enveloppe.png View File


+ 34
- 0
mini-game/ressources/sprites/obstacle/malus_enveloppe.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/malus_enveloppe.png-f09c229bd91d37ed7d80575012e0e852.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/obstacle/malus_enveloppe.png"
13
+dest_files=[ "res://.import/malus_enveloppe.png-f09c229bd91d37ed7d80575012e0e852.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/1.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/1.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/1.png-0eea87ff8af2a924c6e4cf093cc078aa.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/1.png"
13
+dest_files=[ "res://.import/1.png-0eea87ff8af2a924c6e4cf093cc078aa.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/2.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/2.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/2.png-115a0c64a6bcb6c53c460cb5a3c11d7b.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/2.png"
13
+dest_files=[ "res://.import/2.png-115a0c64a6bcb6c53c460cb5a3c11d7b.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/3.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/3.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/3.png-ace1ecdf5c454176a5a88189e2c42278.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/3.png"
13
+dest_files=[ "res://.import/3.png-ace1ecdf5c454176a5a88189e2c42278.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/4.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/4.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/4.png-26b9bc34f50e96c5e3953a76d547f04d.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/4.png"
13
+dest_files=[ "res://.import/4.png-26b9bc34f50e96c5e3953a76d547f04d.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/5.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/5.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/5.png-551f885d3ecd5fde171a49b9e193292c.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/5.png"
13
+dest_files=[ "res://.import/5.png-551f885d3ecd5fde171a49b9e193292c.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/6.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/6.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/6.png-9656f593f2525c3742ab1aea7e3ef476.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/6.png"
13
+dest_files=[ "res://.import/6.png-9656f593f2525c3742ab1aea7e3ef476.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/7.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/7.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/7.png-af441b067544caa40be24bf201584b92.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/7.png"
13
+dest_files=[ "res://.import/7.png-af441b067544caa40be24bf201584b92.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/8.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/8.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/8.png-d93af56c0f324dac96420d179382e245.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/8.png"
13
+dest_files=[ "res://.import/8.png-d93af56c0f324dac96420d179382e245.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/9_1.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/9_1.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/9_1.png-fed35316d11d38fbe332e6a88e3b9136.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/9_1.png"
13
+dest_files=[ "res://.import/9_1.png-fed35316d11d38fbe332e6a88e3b9136.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/9_2.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/9_2.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/9_2.png-e11594a8936a61083a030989f3693bb9.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/9_2.png"
13
+dest_files=[ "res://.import/9_2.png-e11594a8936a61083a030989f3693bb9.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/9_3.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/9_3.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/9_3.png-9f0d68c22cf66fec424e583f41703ddd.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/9_3.png"
13
+dest_files=[ "res://.import/9_3.png-9f0d68c22cf66fec424e583f41703ddd.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/9_4.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/9_4.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/9_4.png-c62c8756d4640ee77bad7a6fa50c136f.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/9_4.png"
13
+dest_files=[ "res://.import/9_4.png-c62c8756d4640ee77bad7a6fa50c136f.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

BIN
mini-game/ressources/sprites/player/man/9_5.png View File


+ 34
- 0
mini-game/ressources/sprites/player/man/9_5.png.import View File

@@ -0,0 +1,34 @@
1
+[remap]
2
+
3
+importer="texture"
4
+type="StreamTexture"
5
+path="res://.import/9_5.png-44e6871430e2673278a762ae325b8493.stex"
6
+metadata={
7
+"vram_texture": false
8
+}
9
+
10
+[deps]
11
+
12
+source_file="res://mini-game/ressources/sprites/player/man/9_5.png"
13
+dest_files=[ "res://.import/9_5.png-44e6871430e2673278a762ae325b8493.stex" ]
14
+
15
+[params]
16
+
17
+compress/mode=0
18
+compress/lossy_quality=0.7
19
+compress/hdr_mode=0
20
+compress/bptc_ldr=0
21
+compress/normal_map=0
22
+flags/repeat=0
23
+flags/filter=true
24
+flags/mipmaps=false
25
+flags/anisotropic=false
26
+flags/srgb=2
27
+process/fix_alpha_border=true
28
+process/premult_alpha=false
29
+process/HDR_as_SRGB=false
30
+process/invert_color=false
31
+stream=false
32
+size_limit=0
33
+detect_3d=true
34
+svg/scale=1.0

+ 24
- 0
mini-game/scenes/bonuses/bonus2.tscn View File

@@ -0,0 +1,24 @@
1
+[gd_scene load_steps=5 format=2]
2
+
3
+[ext_resource path="res://mini-game/scripts/bonus1.gd" type="Script" id=1]
4
+[ext_resource path="res://mini-game/ressources/sprites/bonus/bonus_enveloppe.png" type="Texture" id=2]
5
+[ext_resource path="res://mini-game/scenes/effets/pick_bonus.tscn" type="PackedScene" id=3]
6
+
7
+[sub_resource type="RectangleShape2D" id=1]
8
+extents = Vector2( 51.3758, 37.234 )
9
+
10
+[node name="bonus2" type="Node2D"]
11
+script = ExtResource( 1 )
12
+
13
+[node name="Sprite" type="Sprite" parent="."]
14
+scale = Vector2( 0.2, 0.2 )
15
+texture = ExtResource( 2 )
16
+
17
+[node name="pick_bonus" parent="." instance=ExtResource( 3 )]
18
+
19
+[node name="CollisionShape2D" type="CollisionShape2D" parent="pick_bonus"]
20
+position = Vector2( -0.625, 0 )
21
+shape = SubResource( 1 )
22
+
23
+[node name="notifier" type="VisibilityNotifier2D" parent="."]
24
+[connection signal="body_entered" from="pick_bonus" to="." method="_on_pick_bonus_body_entered"]

+ 7
- 2
mini-game/scenes/decor/scoreUI.gd View File

@@ -3,11 +3,12 @@ extends Control
3 3
 onready var label : Label = $MarginContainer/Label
4 4
 
5 5
 var game_mode
6
-var max_time = 3
6
+var max_time = 30
7 7
 
8 8
 func _ready():
9 9
 	Signals.connect("update_score",self,"update_score")
10 10
 	
11
+	
11 12
 
12 13
 func update_score(score: int):
13 14
 	label.text = String(score)
@@ -34,8 +35,12 @@ func start(mode: String):
34 35
 			print("game_mode not recognized by scoreUI")
35 36
 
36 37
 
38
+func set_max_time(time: int):
39
+	max_time = time
37 40
 
38
-func init(mode):
41
+func init(mode, goal: int):
39 42
 	game_mode = mode
43
+	if (goal != 0):
44
+		max_time = goal
40 45
 	hide()
41 46
 

+ 26
- 0
mini-game/scenes/obstacles/obstacle2.tscn View File

@@ -0,0 +1,26 @@
1
+[gd_scene load_steps=5 format=2]
2
+
3
+[ext_resource path="res://mini-game/scripts/obstacle1.gd" type="Script" id=1]
4
+[ext_resource path="res://mini-game/ressources/sprites/obstacle/malus_enveloppe.png" type="Texture" id=2]
5
+[ext_resource path="res://mini-game/scenes/effets/collision_obstacle.tscn" type="PackedScene" id=3]
6
+
7
+[sub_resource type="RectangleShape2D" id=1]
8
+extents = Vector2( 46.8347, 33.7529 )
9
+
10
+[node name="obstacle2" type="Node2D"]
11
+script = ExtResource( 1 )
12
+
13
+[node name="Sprite" type="Sprite" parent="."]
14
+position = Vector2( -0.0556164, -0.166861 )
15
+scale = Vector2( 0.2, 0.2 )
16
+texture = ExtResource( 2 )
17
+
18
+[node name="collision_obstacle" parent="." instance=ExtResource( 3 )]
19
+
20
+[node name="CollisionShape2D" type="CollisionShape2D" parent="collision_obstacle"]
21
+shape = SubResource( 1 )
22
+
23
+[node name="notifier" type="VisibilityNotifier2D" parent="."]
24
+position = Vector2( -0.333708, -0.333708 )
25
+scale = Vector2( 4.70418, 3.36934 )
26
+[connection signal="body_entered" from="collision_obstacle" to="." method="_on_collision_obstacle_body_entered"]

+ 25
- 5
mini-game/scenes/players/player2.tscn View File

@@ -1,4 +1,4 @@
1
-[gd_scene load_steps=16 format=2]
1
+[gd_scene load_steps=25 format=2]
2 2
 
3 3
 [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run7.png" type="Texture" id=1]
4 4
 [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run5.png" type="Texture" id=2]
@@ -12,6 +12,15 @@
12 12
 [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run1.png" type="Texture" id=10]
13 13
 [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_jump1.png" type="Texture" id=11]
14 14
 [ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_jump0.png" type="Texture" id=12]
15
+[ext_resource path="res://mini-game/ressources/sprites/player/man/9_2.png" type="Texture" id=13]
16
+[ext_resource path="res://mini-game/ressources/sprites/player/man/4.png" type="Texture" id=14]
17
+[ext_resource path="res://mini-game/ressources/sprites/player/man/2.png" type="Texture" id=15]
18
+[ext_resource path="res://mini-game/ressources/sprites/player/man/9_4.png" type="Texture" id=16]
19
+[ext_resource path="res://mini-game/ressources/sprites/player/man/9_3.png" type="Texture" id=17]
20
+[ext_resource path="res://mini-game/ressources/sprites/player/man/1.png" type="Texture" id=18]
21
+[ext_resource path="res://mini-game/ressources/sprites/player/man/6.png" type="Texture" id=19]
22
+[ext_resource path="res://mini-game/ressources/sprites/player/man/7.png" type="Texture" id=20]
23
+[ext_resource path="res://mini-game/ressources/sprites/player/man/9_1.png" type="Texture" id=21]
15 24
 
16 25
 [sub_resource type="SpriteFrames" id=1]
17 26
 animations = [ {
@@ -24,10 +33,20 @@ animations = [ {
24 33
 "loop": true,
25 34
 "name": "jump",
26 35
 "speed": 5.0
36
+}, {
37
+"frames": [ ExtResource( 18 ), ExtResource( 15 ), ExtResource( 14 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 13 ), ExtResource( 17 ) ],
38
+"loop": true,
39
+"name": "man_run",
40
+"speed": 5.0
41
+}, {
42
+"frames": [ ExtResource( 19 ), ExtResource( 20 ), ExtResource( 16 ) ],
43
+"loop": true,
44
+"name": "man_jump",
45
+"speed": 5.0
27 46
 } ]
28 47
 
29 48
 [sub_resource type="RectangleShape2D" id=2]
30
-extents = Vector2( 4.46927, 8.75317 )
49
+extents = Vector2( 4.46927, 10.285 )
31 50
 
32 51
 [sub_resource type="RectangleShape2D" id=3]
33 52
 extents = Vector2( 7.82863, 6.33675 )
@@ -39,12 +58,13 @@ jump_vitesse = 1000.0
39 58
 gravite = 40.0
40 59
 
41 60
 [node name="AnimatedSprite" type="AnimatedSprite" parent="."]
42
-position = Vector2( -0.0702338, 0.280932 )
61
+position = Vector2( -1.76303, -0.98938 )
62
+scale = Vector2( 0.0421291, 0.0421291 )
43 63
 frames = SubResource( 1 )
44
-animation = "run"
64
+animation = "man_jump"
45 65
 
46 66
 [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
47
-position = Vector2( 0, 0.471936 )
67
+position = Vector2( -0.0396851, -0.480505 )
48 68
 shape = SubResource( 2 )
49 69
 
50 70
 [node name="Area2D" type="Area2D" parent="."]

+ 4
- 2
mini-game/scenes/spawner/spawner.tscn View File

@@ -1,12 +1,14 @@
1
-[gd_scene load_steps=4 format=2]
1
+[gd_scene load_steps=6 format=2]
2 2
 
3 3
 [ext_resource path="res://mini-game/scripts/spawner.gd" type="Script" id=1]
4 4
 [ext_resource path="res://mini-game/scenes/obstacles/obstacle1.tscn" type="PackedScene" id=2]
5 5
 [ext_resource path="res://mini-game/scenes/bonuses/bonus1.tscn" type="PackedScene" id=3]
6
+[ext_resource path="res://mini-game/scenes/bonuses/bonus2.tscn" type="PackedScene" id=4]
7
+[ext_resource path="res://mini-game/scenes/obstacles/obstacle2.tscn" type="PackedScene" id=5]
6 8
 
7 9
 [node name="spawner" type="Node2D"]
8 10
 script = ExtResource( 1 )
9
-scenes = [ ExtResource( 3 ), ExtResource( 2 ) ]
11
+scenes = [ ExtResource( 3 ), ExtResource( 2 ), ExtResource( 4 ), ExtResource( 5 ) ]
10 12
 
11 13
 [node name="Timer" type="Timer" parent="."]
12 14
 wait_time = 2.094

+ 6
- 4
mini-game/scripts/player2.gd View File

@@ -5,7 +5,7 @@ var vitesse = Vector2.ZERO
5 5
 var score = 0
6 6
 var score_goal = 10
7 7
 
8
-export var jump_vitesse = 600.0
8
+export var jump_vitesse = 800.0
9 9
 export var gravite = 20.0
10 10
 
11 11
 enum {
@@ -42,11 +42,11 @@ func _physics_process(delta):
42 42
 	if player_enabled:
43 43
 		match state:
44 44
 			RUN:
45
-				animation.play("run")
45
+				animation.play("man_run")
46 46
 			JUMP:
47 47
 				vitesse = Vector2.ZERO
48 48
 				vitesse.y -= jump_vitesse
49
-				animation.play("jump")
49
+				animation.play("man_jump")
50 50
 				state = IDLE
51 51
 			IDLE:
52 52
 				pass
@@ -92,10 +92,12 @@ func player_die():
92 92
 	stop()
93 93
 
94 94
 
95
-func start(mode: String):
95
+func start(mode: String, goal: int):
96 96
 	show()
97 97
 	match mode:
98 98
 		"score":
99
+			if (goal != 0):
100
+				score_goal = goal
99 101
 			game_mode = "score"
100 102
 		"time":
101 103
 			game_mode = "time"

+ 24
- 6
mini-game/scripts/spawner.gd View File

@@ -6,9 +6,10 @@ var random_scene = RandomNumberGenerator.new()
6 6
 var scene_index = 0;
7 7
 var last_object
8 8
 var end_of_game = false
9
-
10 9
 var spawner_enabled = false
11
-
10
+var timer_speed = 0.99
11
+var random_threshold = 50
12
+var scenes_offset = 0
12 13
 
13 14
 func _ready():
14 15
 	Signals.connect("die",self,"game_over")
@@ -18,11 +19,18 @@ func _ready():
18 19
 func _on_Timer_timeout():
19 20
 	if spawner_enabled:
20 21
 		random_scene.randomize()
21
-		scene_index = random_scene.randi_range(0,scenes.size()-1)
22
-		var tmp = scenes[scene_index].instance()
22
+		scene_index = random_scene.randi_range(1,100)
23
+		if(scene_index >= random_threshold):
24
+			scene_index = 1
25
+		else:
26
+			scene_index = 0
27
+		var tmp = scenes[scene_index+scenes_offset*2].instance()
23 28
 		$items.add_child(tmp)
24 29
 		last_object = tmp
25
-		self.get_node("Timer").wait_time *= 0.99
30
+		if(self.get_node("Timer").wait_time <= 1):
31
+			self.get_node("Timer").wait_time = 1
32
+		else:
33
+			self.get_node("Timer").wait_time *= timer_speed
26 34
 		self.get_node("Timer").start()
27 35
 
28 36
 
@@ -31,7 +39,17 @@ func game_over():
31 39
 	last_object.queue_free()
32 40
 
33 41
 
34
-func start():
42
+func start(difficulty, version):
43
+	match difficulty:
44
+		"easy":
45
+			timer_speed = 0.99
46
+			random_threshold = 50
47
+		"hard":
48
+			timer_speed = 0.95
49
+			random_threshold = 33
50
+		_:
51
+			pass
52
+	scenes_offset = version
35 53
 	spawner_enabled = true
36 54
 	self.get_node("Timer").set_paused(false)
37 55
 

+ 3
- 3
scenes/Main.gd View File

@@ -39,7 +39,7 @@ func _on_Dialogic_signal_received(value: String):
39 39
 				start_minigame()
40 40
 			"setup_minigame":
41 41
 				if (args.size() >= 3):
42
-					setup_minigame(args[1], args[2], args[3])
42
+					setup_minigame(args[1], int(args[2]), args[3], args[4], args[5], int(args[6]))
43 43
 				else:
44 44
 					print("not enough arguments for start_minigame")
45 45
 			"end_game":
@@ -48,8 +48,8 @@ func _on_Dialogic_signal_received(value: String):
48 48
 				print("wrong type")
49 49
 
50 50
 
51
-func setup_minigame(mode: String, next_timeline_lose: String, next_timeline_win):
52
-	mini_game.setup(mode, next_timeline_lose, next_timeline_win)
51
+func setup_minigame(mode: String, goal: int, difficulty: String, next_timeline_lose: String, next_timeline_win: String, version: int):
52
+	mini_game.setup(mode, goal, difficulty, next_timeline_lose, next_timeline_win, version)
53 53
 
54 54
 
55 55
 func start_minigame():

Loading…
Cancel
Save