add minigame features
|
@ -14,18 +14,28 @@ var next_timeline_lose := ""
|
|||
var next_timeline_win := ""
|
||||
|
||||
var game_mode = ""
|
||||
var game_goal = 10
|
||||
var game_difficulty = "easy"
|
||||
var game_version = 0
|
||||
|
||||
var MUSIC = "res://music/mini_jeu.ogg"
|
||||
|
||||
|
||||
func _ready():
|
||||
Signals.connect("die", self, "on_game_over")
|
||||
Signals.connect("win", self, "on_win")
|
||||
|
||||
|
||||
func setup(mode: String, next_lose: String, next_win: String):
|
||||
func setup(mode: String, goal: int, difficulty: String, next_lose: String, next_win: String, version: int):
|
||||
game_goal = goal
|
||||
if(difficulty == "hard"):
|
||||
game_difficulty = "hard"
|
||||
else:
|
||||
game_difficulty = "easy"
|
||||
game_version = version
|
||||
print("minigame: " + mode + " " + next_lose + " " + next_win)
|
||||
set_mode(mode)
|
||||
scoreUI.init(mode)
|
||||
scoreUI.init(mode, game_goal)
|
||||
next_timeline_lose = next_lose
|
||||
next_timeline_win = next_win
|
||||
|
||||
|
@ -54,11 +64,11 @@ func start():
|
|||
start_timer_UI.update_timer("GO !")
|
||||
instructionsUI._init()
|
||||
foreground.start()
|
||||
player.start(game_mode)
|
||||
player.start(game_mode, game_goal)
|
||||
yield(t, "timeout")
|
||||
yield(t, "timeout")
|
||||
start_timer_UI.hide()
|
||||
spawner.start()
|
||||
spawner.start(game_difficulty, game_version)
|
||||
scoreUI.start(game_mode)
|
||||
t.queue_free()
|
||||
|
||||
|
|
BIN
mini-game/ressources/sprites/bonus/bonus_enveloppe.png
Normal file
After Width: | Height: | Size: 39 KiB |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bonus_enveloppe.png-99ee6798e10ed7de038cee7885cc8217.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/bonus/bonus_enveloppe.png"
|
||||
dest_files=[ "res://.import/bonus_enveloppe.png-99ee6798e10ed7de038cee7885cc8217.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/obstacle/malus_enveloppe.png
Normal file
After Width: | Height: | Size: 42 KiB |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/malus_enveloppe.png-f09c229bd91d37ed7d80575012e0e852.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/obstacle/malus_enveloppe.png"
|
||||
dest_files=[ "res://.import/malus_enveloppe.png-f09c229bd91d37ed7d80575012e0e852.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/1.png
Normal file
After Width: | Height: | Size: 30 KiB |
34
mini-game/ressources/sprites/player/man/1.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/1.png-0eea87ff8af2a924c6e4cf093cc078aa.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/1.png"
|
||||
dest_files=[ "res://.import/1.png-0eea87ff8af2a924c6e4cf093cc078aa.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/2.png
Normal file
After Width: | Height: | Size: 33 KiB |
34
mini-game/ressources/sprites/player/man/2.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/2.png-115a0c64a6bcb6c53c460cb5a3c11d7b.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/2.png"
|
||||
dest_files=[ "res://.import/2.png-115a0c64a6bcb6c53c460cb5a3c11d7b.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/3.png
Normal file
After Width: | Height: | Size: 41 KiB |
34
mini-game/ressources/sprites/player/man/3.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/3.png-ace1ecdf5c454176a5a88189e2c42278.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/3.png"
|
||||
dest_files=[ "res://.import/3.png-ace1ecdf5c454176a5a88189e2c42278.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/4.png
Normal file
After Width: | Height: | Size: 48 KiB |
34
mini-game/ressources/sprites/player/man/4.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/4.png-26b9bc34f50e96c5e3953a76d547f04d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/4.png"
|
||||
dest_files=[ "res://.import/4.png-26b9bc34f50e96c5e3953a76d547f04d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/5.png
Normal file
After Width: | Height: | Size: 50 KiB |
34
mini-game/ressources/sprites/player/man/5.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/5.png-551f885d3ecd5fde171a49b9e193292c.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/5.png"
|
||||
dest_files=[ "res://.import/5.png-551f885d3ecd5fde171a49b9e193292c.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/6.png
Normal file
After Width: | Height: | Size: 51 KiB |
34
mini-game/ressources/sprites/player/man/6.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/6.png-9656f593f2525c3742ab1aea7e3ef476.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/6.png"
|
||||
dest_files=[ "res://.import/6.png-9656f593f2525c3742ab1aea7e3ef476.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/7.png
Normal file
After Width: | Height: | Size: 48 KiB |
34
mini-game/ressources/sprites/player/man/7.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/7.png-af441b067544caa40be24bf201584b92.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/7.png"
|
||||
dest_files=[ "res://.import/7.png-af441b067544caa40be24bf201584b92.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/8.png
Normal file
After Width: | Height: | Size: 41 KiB |
34
mini-game/ressources/sprites/player/man/8.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/8.png-d93af56c0f324dac96420d179382e245.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/8.png"
|
||||
dest_files=[ "res://.import/8.png-d93af56c0f324dac96420d179382e245.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/9_1.png
Normal file
After Width: | Height: | Size: 37 KiB |
34
mini-game/ressources/sprites/player/man/9_1.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/9_1.png-fed35316d11d38fbe332e6a88e3b9136.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/9_1.png"
|
||||
dest_files=[ "res://.import/9_1.png-fed35316d11d38fbe332e6a88e3b9136.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/9_2.png
Normal file
After Width: | Height: | Size: 32 KiB |
34
mini-game/ressources/sprites/player/man/9_2.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/9_2.png-e11594a8936a61083a030989f3693bb9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/9_2.png"
|
||||
dest_files=[ "res://.import/9_2.png-e11594a8936a61083a030989f3693bb9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/9_3.png
Normal file
After Width: | Height: | Size: 49 KiB |
34
mini-game/ressources/sprites/player/man/9_3.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/9_3.png-9f0d68c22cf66fec424e583f41703ddd.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/9_3.png"
|
||||
dest_files=[ "res://.import/9_3.png-9f0d68c22cf66fec424e583f41703ddd.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/9_4.png
Normal file
After Width: | Height: | Size: 47 KiB |
34
mini-game/ressources/sprites/player/man/9_4.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/9_4.png-c62c8756d4640ee77bad7a6fa50c136f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/9_4.png"
|
||||
dest_files=[ "res://.import/9_4.png-c62c8756d4640ee77bad7a6fa50c136f.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
mini-game/ressources/sprites/player/man/9_5.png
Normal file
After Width: | Height: | Size: 30 KiB |
34
mini-game/ressources/sprites/player/man/9_5.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/9_5.png-44e6871430e2673278a762ae325b8493.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mini-game/ressources/sprites/player/man/9_5.png"
|
||||
dest_files=[ "res://.import/9_5.png-44e6871430e2673278a762ae325b8493.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
24
mini-game/scenes/bonuses/bonus2.tscn
Normal file
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scripts/bonus1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/bonus/bonus_enveloppe.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/pick_bonus.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 51.3758, 37.234 )
|
||||
|
||||
[node name="bonus2" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="pick_bonus" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="pick_bonus"]
|
||||
position = Vector2( -0.625, 0 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
[connection signal="body_entered" from="pick_bonus" to="." method="_on_pick_bonus_body_entered"]
|
|
@ -3,12 +3,13 @@ extends Control
|
|||
onready var label : Label = $MarginContainer/Label
|
||||
|
||||
var game_mode
|
||||
var max_time = 3
|
||||
var max_time = 30
|
||||
|
||||
func _ready():
|
||||
Signals.connect("update_score",self,"update_score")
|
||||
|
||||
|
||||
|
||||
func update_score(score: int):
|
||||
label.text = String(score)
|
||||
|
||||
|
@ -34,8 +35,12 @@ func start(mode: String):
|
|||
print("game_mode not recognized by scoreUI")
|
||||
|
||||
|
||||
func set_max_time(time: int):
|
||||
max_time = time
|
||||
|
||||
func init(mode):
|
||||
func init(mode, goal: int):
|
||||
game_mode = mode
|
||||
if (goal != 0):
|
||||
max_time = goal
|
||||
hide()
|
||||
|
||||
|
|
26
mini-game/scenes/obstacles/obstacle2.tscn
Normal file
|
@ -0,0 +1,26 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scripts/obstacle1.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/obstacle/malus_enveloppe.png" type="Texture" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/effets/collision_obstacle.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 46.8347, 33.7529 )
|
||||
|
||||
[node name="obstacle2" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( -0.0556164, -0.166861 )
|
||||
scale = Vector2( 0.2, 0.2 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="collision_obstacle" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="collision_obstacle"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="notifier" type="VisibilityNotifier2D" parent="."]
|
||||
position = Vector2( -0.333708, -0.333708 )
|
||||
scale = Vector2( 4.70418, 3.36934 )
|
||||
[connection signal="body_entered" from="collision_obstacle" to="." method="_on_collision_obstacle_body_entered"]
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=16 format=2]
|
||||
[gd_scene load_steps=25 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run7.png" type="Texture" id=1]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run5.png" type="Texture" id=2]
|
||||
|
@ -12,6 +12,15 @@
|
|||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_run1.png" type="Texture" id=10]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_jump1.png" type="Texture" id=11]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/dino/dino_jump0.png" type="Texture" id=12]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/9_2.png" type="Texture" id=13]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/4.png" type="Texture" id=14]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/2.png" type="Texture" id=15]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/9_4.png" type="Texture" id=16]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/9_3.png" type="Texture" id=17]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/1.png" type="Texture" id=18]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/6.png" type="Texture" id=19]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/7.png" type="Texture" id=20]
|
||||
[ext_resource path="res://mini-game/ressources/sprites/player/man/9_1.png" type="Texture" id=21]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
|
@ -24,10 +33,20 @@ animations = [ {
|
|||
"loop": true,
|
||||
"name": "jump",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 18 ), ExtResource( 15 ), ExtResource( 14 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 13 ), ExtResource( 17 ) ],
|
||||
"loop": true,
|
||||
"name": "man_run",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 19 ), ExtResource( 20 ), ExtResource( 16 ) ],
|
||||
"loop": true,
|
||||
"name": "man_jump",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 4.46927, 8.75317 )
|
||||
extents = Vector2( 4.46927, 10.285 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
extents = Vector2( 7.82863, 6.33675 )
|
||||
|
@ -39,12 +58,13 @@ jump_vitesse = 1000.0
|
|||
gravite = 40.0
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
position = Vector2( -0.0702338, 0.280932 )
|
||||
position = Vector2( -1.76303, -0.98938 )
|
||||
scale = Vector2( 0.0421291, 0.0421291 )
|
||||
frames = SubResource( 1 )
|
||||
animation = "run"
|
||||
animation = "man_jump"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 0, 0.471936 )
|
||||
position = Vector2( -0.0396851, -0.480505 )
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://mini-game/scripts/spawner.gd" type="Script" id=1]
|
||||
[ext_resource path="res://mini-game/scenes/obstacles/obstacle1.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://mini-game/scenes/bonuses/bonus1.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://mini-game/scenes/bonuses/bonus2.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://mini-game/scenes/obstacles/obstacle2.tscn" type="PackedScene" id=5]
|
||||
|
||||
[node name="spawner" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
scenes = [ ExtResource( 3 ), ExtResource( 2 ) ]
|
||||
scenes = [ ExtResource( 3 ), ExtResource( 2 ), ExtResource( 4 ), ExtResource( 5 ) ]
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 2.094
|
||||
|
|
|
@ -5,7 +5,7 @@ var vitesse = Vector2.ZERO
|
|||
var score = 0
|
||||
var score_goal = 10
|
||||
|
||||
export var jump_vitesse = 600.0
|
||||
export var jump_vitesse = 800.0
|
||||
export var gravite = 20.0
|
||||
|
||||
enum {
|
||||
|
@ -42,11 +42,11 @@ func _physics_process(delta):
|
|||
if player_enabled:
|
||||
match state:
|
||||
RUN:
|
||||
animation.play("run")
|
||||
animation.play("man_run")
|
||||
JUMP:
|
||||
vitesse = Vector2.ZERO
|
||||
vitesse.y -= jump_vitesse
|
||||
animation.play("jump")
|
||||
animation.play("man_jump")
|
||||
state = IDLE
|
||||
IDLE:
|
||||
pass
|
||||
|
@ -92,10 +92,12 @@ func player_die():
|
|||
stop()
|
||||
|
||||
|
||||
func start(mode: String):
|
||||
func start(mode: String, goal: int):
|
||||
show()
|
||||
match mode:
|
||||
"score":
|
||||
if (goal != 0):
|
||||
score_goal = goal
|
||||
game_mode = "score"
|
||||
"time":
|
||||
game_mode = "time"
|
||||
|
|
|
@ -6,9 +6,10 @@ var random_scene = RandomNumberGenerator.new()
|
|||
var scene_index = 0;
|
||||
var last_object
|
||||
var end_of_game = false
|
||||
|
||||
var spawner_enabled = false
|
||||
|
||||
var timer_speed = 0.99
|
||||
var random_threshold = 50
|
||||
var scenes_offset = 0
|
||||
|
||||
func _ready():
|
||||
Signals.connect("die",self,"game_over")
|
||||
|
@ -18,11 +19,18 @@ func _ready():
|
|||
func _on_Timer_timeout():
|
||||
if spawner_enabled:
|
||||
random_scene.randomize()
|
||||
scene_index = random_scene.randi_range(0,scenes.size()-1)
|
||||
var tmp = scenes[scene_index].instance()
|
||||
scene_index = random_scene.randi_range(1,100)
|
||||
if(scene_index >= random_threshold):
|
||||
scene_index = 1
|
||||
else:
|
||||
scene_index = 0
|
||||
var tmp = scenes[scene_index+scenes_offset*2].instance()
|
||||
$items.add_child(tmp)
|
||||
last_object = tmp
|
||||
self.get_node("Timer").wait_time *= 0.99
|
||||
if(self.get_node("Timer").wait_time <= 1):
|
||||
self.get_node("Timer").wait_time = 1
|
||||
else:
|
||||
self.get_node("Timer").wait_time *= timer_speed
|
||||
self.get_node("Timer").start()
|
||||
|
||||
|
||||
|
@ -31,7 +39,17 @@ func game_over():
|
|||
last_object.queue_free()
|
||||
|
||||
|
||||
func start():
|
||||
func start(difficulty, version):
|
||||
match difficulty:
|
||||
"easy":
|
||||
timer_speed = 0.99
|
||||
random_threshold = 50
|
||||
"hard":
|
||||
timer_speed = 0.95
|
||||
random_threshold = 33
|
||||
_:
|
||||
pass
|
||||
scenes_offset = version
|
||||
spawner_enabled = true
|
||||
self.get_node("Timer").set_paused(false)
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ func _on_Dialogic_signal_received(value: String):
|
|||
start_minigame()
|
||||
"setup_minigame":
|
||||
if (args.size() >= 3):
|
||||
setup_minigame(args[1], args[2], args[3])
|
||||
setup_minigame(args[1], int(args[2]), args[3], args[4], args[5], int(args[6]))
|
||||
else:
|
||||
print("not enough arguments for start_minigame")
|
||||
"end_game":
|
||||
|
@ -48,8 +48,8 @@ func _on_Dialogic_signal_received(value: String):
|
|||
print("wrong type")
|
||||
|
||||
|
||||
func setup_minigame(mode: String, next_timeline_lose: String, next_timeline_win):
|
||||
mini_game.setup(mode, next_timeline_lose, next_timeline_win)
|
||||
func setup_minigame(mode: String, goal: int, difficulty: String, next_timeline_lose: String, next_timeline_win: String, version: int):
|
||||
mini_game.setup(mode, goal, difficulty, next_timeline_lose, next_timeline_win, version)
|
||||
|
||||
|
||||
func start_minigame():
|
||||
|
|