[EDIT] gameplay base working
This commit is contained in:
parent
9bae75a55a
commit
244e5ff82e
BIN
Assets/lifepaint 1 final.png
Normal file
BIN
Assets/lifepaint 1 final.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
34
Assets/lifepaint 1 final.png.import
Normal file
34
Assets/lifepaint 1 final.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/lifepaint 1 final.png-ed7305c794fd740b52098adc99c0b1e0.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/lifepaint 1 final.png"
|
||||
dest_files=[ "res://.import/lifepaint 1 final.png-ed7305c794fd740b52098adc99c0b1e0.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=false
|
||||
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=false
|
||||
svg/scale=1.0
|
BIN
Assets/lifepaint 2 final.png
Normal file
BIN
Assets/lifepaint 2 final.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
34
Assets/lifepaint 2 final.png.import
Normal file
34
Assets/lifepaint 2 final.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/lifepaint 2 final.png-910dc4004cd792d9ab21cd128233abf7.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/lifepaint 2 final.png"
|
||||
dest_files=[ "res://.import/lifepaint 2 final.png-910dc4004cd792d9ab21cd128233abf7.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=false
|
||||
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=false
|
||||
svg/scale=1.0
|
BIN
Assets/lifepaint 3 final.png
Normal file
BIN
Assets/lifepaint 3 final.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
34
Assets/lifepaint 3 final.png.import
Normal file
34
Assets/lifepaint 3 final.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/lifepaint 3 final.png-9d1c74c40e6bb834ea46106e7ffb1602.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/lifepaint 3 final.png"
|
||||
dest_files=[ "res://.import/lifepaint 3 final.png-9d1c74c40e6bb834ea46106e7ffb1602.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=false
|
||||
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=false
|
||||
svg/scale=1.0
|
12
Scene/HealthBar.gd
Normal file
12
Scene/HealthBar.gd
Normal file
@ -0,0 +1,12 @@
|
||||
extends Control
|
||||
|
||||
onready var healthBar = $HealthBar
|
||||
onready var updateTween = $UpdateTween
|
||||
|
||||
func healthUpdated(health):
|
||||
healthBar.value = health
|
||||
updateTween.interpolate_property(healthBar, "value", health, 0.2, Tween.TRANS_SINE, Tween.EASE_IN_OUT)
|
||||
updateTween.start()
|
||||
|
||||
func maxHealthUpdated(maxHealth):
|
||||
healthBar.max_value = maxHealth
|
31
Scene/HealthBar.tscn
Normal file
31
Scene/HealthBar.tscn
Normal file
@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Assets/lifepaint 3 final.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Assets/lifepaint 1 final.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Assets/lifepaint 2 final.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Scene/HealthBar.gd" type="Script" id=4]
|
||||
|
||||
[node name="HealthBar" type="Control" groups=[
|
||||
"healthbar",
|
||||
]]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HealthBar" type="TextureProgress" parent="."]
|
||||
margin_top = 39.6669
|
||||
margin_right = 332.0
|
||||
margin_bottom = 79.6669
|
||||
rect_scale = Vector2( 1.75, 1.75 )
|
||||
value = 99.0
|
||||
texture_under = ExtResource( 3 )
|
||||
texture_over = ExtResource( 2 )
|
||||
texture_progress = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="UpdateTween" type="Tween" parent="."]
|
@ -1,122 +1,33 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Scene/Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Assets/Placeholder.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Scene/Clopinette.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://Scene/EndGameWindow.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://Scene/GameManager.tscn" type="PackedScene" id=5]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 15.6178, 15.7669 )
|
||||
[ext_resource path="res://Scene/HealthBar.tscn" type="PackedScene" id=6]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="HealthBar" parent="." instance=ExtResource( 6 )]
|
||||
margin_left = 30.0
|
||||
margin_top = -5.0
|
||||
margin_right = 30.0
|
||||
margin_bottom = -5.0
|
||||
|
||||
[node name="HealthBar2" parent="." instance=ExtResource( 6 )]
|
||||
margin_left = 1288.14
|
||||
margin_top = -5.0
|
||||
margin_right = 1288.14
|
||||
margin_bottom = -5.0
|
||||
|
||||
[node name="Player1" parent="." groups=[
|
||||
"player",
|
||||
] instance=ExtResource( 1 )]
|
||||
position = Vector2( 119.977, 88.9695 )
|
||||
|
||||
[node name="obstacle" type="StaticBody2D" parent="."]
|
||||
position = Vector2( 57.697, 87.6551 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="obstacle"]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="obstacle"]
|
||||
shape = SubResource( 1 )
|
||||
position = Vector2( 317.194, 221.462 )
|
||||
|
||||
[node name="Player2" parent="." groups=[
|
||||
"player",
|
||||
] instance=ExtResource( 1 )]
|
||||
position = Vector2( 221.278, 126.45 )
|
||||
|
||||
[node name="Clopinette" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 96.6926, 271.557 )
|
||||
scriptName = "res://Scripts/PaintEffects/Invisibility.gd"
|
||||
|
||||
[node name="Clopinette2" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 305.804, 276.773 )
|
||||
scriptName = "res://Scripts/PaintEffects/Upscale.gd"
|
||||
|
||||
[node name="Clopinette3" parent="." groups=[
|
||||
"bucket",
|
||||
] instance=ExtResource( 3 )]
|
||||
position = Vector2( 459.898, 280.888 )
|
||||
scriptName = "res://Scripts/PaintEffects/Downscale.gd"
|
||||
|
||||
[node name="Clopinette4" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 604.527, 280.888 )
|
||||
scriptName = "res://Scripts/PaintEffects/ConfuseDirections.gd"
|
||||
|
||||
[node name="Clopinette6" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 521.04, 463.822 )
|
||||
|
||||
[node name="Clopinette5" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 204.282, 391.385 )
|
||||
scriptName = "res://Scripts/PaintEffects/Slippery.gd"
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_left = 67.496
|
||||
margin_top = 232.645
|
||||
margin_right = 135.496
|
||||
margin_bottom = 246.645
|
||||
text = "Invisibilité"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label6" type="Label" parent="."]
|
||||
margin_left = 480.017
|
||||
margin_top = 416.806
|
||||
margin_right = 548.017
|
||||
margin_bottom = 430.806
|
||||
text = "Randomisé !"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
margin_left = 263.559
|
||||
margin_top = 234.351
|
||||
margin_right = 347.559
|
||||
margin_bottom = 248.351
|
||||
text = "Gigantisation"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label3" type="Label" parent="."]
|
||||
margin_left = 419.404
|
||||
margin_top = 238.441
|
||||
margin_right = 503.404
|
||||
margin_bottom = 252.441
|
||||
text = "Gnomisme"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label4" type="Label" parent="."]
|
||||
margin_left = 564.032
|
||||
margin_top = 238.441
|
||||
margin_right = 648.032
|
||||
margin_bottom = 252.441
|
||||
text = "Confusion"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label5" type="Label" parent="."]
|
||||
margin_left = 163.787
|
||||
margin_top = 348.938
|
||||
margin_right = 247.787
|
||||
margin_bottom = 362.938
|
||||
text = "Patinoire"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
position = Vector2( 1593.81, 209.193 )
|
||||
|
||||
[node name="CanvasLayer" parent="." instance=ExtResource( 4 )]
|
||||
|
||||
@ -125,19 +36,19 @@ __meta__ = {
|
||||
[node name="SpawnPoint" type="Node2D" parent="." groups=[
|
||||
"spawn_point",
|
||||
]]
|
||||
position = Vector2( 884.401, 163.634 )
|
||||
position = Vector2( 588.302, 346.748 )
|
||||
|
||||
[node name="SpawnPoint2" type="Node2D" parent="." groups=[
|
||||
"spawn_point",
|
||||
]]
|
||||
position = Vector2( 812.324, 467.525 )
|
||||
position = Vector2( 1266.21, 862.973 )
|
||||
|
||||
[node name="SpawnPoint3" type="Node2D" parent="." groups=[
|
||||
"spawn_point",
|
||||
]]
|
||||
position = Vector2( 1203.88, 315.579 )
|
||||
position = Vector2( 1659.71, 594.146 )
|
||||
|
||||
[node name="SpawnPoint4" type="Node2D" parent="." groups=[
|
||||
"spawn_point",
|
||||
]]
|
||||
position = Vector2( 477.265, 794.792 )
|
||||
position = Vector2( 340.904, 670.119 )
|
||||
|
@ -2,13 +2,17 @@ extends Node2D
|
||||
|
||||
onready var spawnPoints = get_tree().get_nodes_in_group("spawn_point")
|
||||
|
||||
var buckets = Array()
|
||||
var bucket = load("res://Scene/Clopinette.tscn")
|
||||
|
||||
func _ready():
|
||||
buckets.append(load("res://Scene/Player.tscn"))
|
||||
var scripts = ["res://Scripts/PaintEffects/ConfuseDirections.gd",
|
||||
"res://Scripts/PaintEffects/Downscale.gd",
|
||||
"res://Scripts/PaintEffects/Invisibility.gd",
|
||||
"res://Scripts/PaintEffects/Slippery.gd",
|
||||
"res://Scripts/PaintEffects/Upscale.gd"]
|
||||
|
||||
func spawnBucket():
|
||||
var newBucket = buckets[randi() % buckets.size()].instance()
|
||||
var newBucket = bucket.instance()
|
||||
newBucket.scriptName = scripts[randi() % scripts.size()]
|
||||
self.get_parent().add_child(newBucket)
|
||||
newBucket.add_to_group("bucket")
|
||||
newBucket.set_position(spawnPoints[randi() % spawnPoints.size()].get_position())
|
||||
@ -16,8 +20,7 @@ func spawnBucket():
|
||||
func _process(delta):
|
||||
if get_tree().get_nodes_in_group("bucket").empty():
|
||||
spawnBucket()
|
||||
#endGame()
|
||||
|
||||
|
||||
func endGame():
|
||||
get_node("/root/World/CanvasLayer/Window").showEndGameWindow(getWinner())
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
extends KinematicBody2D
|
||||
|
||||
var MAX_SPEED = 200
|
||||
var ACCELERATION = 1000
|
||||
var FRICTION = 1000
|
||||
var MAX_SPEED = 600
|
||||
var ACCELERATION = 1800
|
||||
var FRICTION = 2000
|
||||
var MAX_LIFE = 30
|
||||
const PICKUP_BONUS = 5
|
||||
|
||||
var vel = Vector2.ZERO
|
||||
var curLife = MAX_LIFE
|
||||
@ -23,13 +24,21 @@ var inputs = ["ui_up", "ui_right", "ui_down", "ui_left"]
|
||||
onready var animationPlayer = $AnimationPlayer
|
||||
onready var animationTree = $AnimationTree
|
||||
onready var animationState = animationTree.get("parameters/playback")
|
||||
var healthBar = null
|
||||
|
||||
func _ready():
|
||||
if self.name == "Player1":
|
||||
healthBar = get_tree().get_nodes_in_group("healthbar")[0]
|
||||
elif self.name == "Player2":
|
||||
healthBar = get_tree().get_nodes_in_group("healthbar")[1]
|
||||
healthBar.maxHealthUpdated(MAX_LIFE)
|
||||
|
||||
func _process(delta):
|
||||
updatePaintEffects(delta)
|
||||
curLife -= delta
|
||||
if curLife <= 0:
|
||||
#fin du game laul
|
||||
pass
|
||||
get_node("/root/World/GameManager").endGame()
|
||||
healthBar.healthUpdated(curLife)
|
||||
|
||||
func _physics_process(delta):
|
||||
var input_vector = Vector2.ZERO
|
||||
@ -69,4 +78,5 @@ func updatePaintEffects(delta):
|
||||
coroutines.append(rout)
|
||||
|
||||
func addCoroutine(routine):
|
||||
curLife = MAX_LIFE if (curLife + PICKUP_BONUS > MAX_LIFE) else curLife + PICKUP_BONUS
|
||||
coroutines.append(routine)
|
||||
|
Loading…
x
Reference in New Issue
Block a user