Changed viewport, added Confusion effect
This commit is contained in:
parent
12e42c5188
commit
a89bb98b26
@ -36,9 +36,13 @@ position = Vector2( 305.804, 276.773 )
|
||||
scriptName = "res://Scripts/PaintEffects/Upscale.gd"
|
||||
|
||||
[node name="Clopinette3" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 580.834, 292.621 )
|
||||
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="Label" type="Label" parent="."]
|
||||
margin_left = 67.496
|
||||
margin_top = 232.645
|
||||
@ -60,11 +64,21 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="Label3" type="Label" parent="."]
|
||||
margin_left = 551.169
|
||||
margin_top = 251.979
|
||||
margin_right = 635.169
|
||||
margin_bottom = 265.979
|
||||
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
|
||||
}
|
||||
|
24
Scripts/PaintEffects/ConfuseDirections.gd
Normal file
24
Scripts/PaintEffects/ConfuseDirections.gd
Normal file
@ -0,0 +1,24 @@
|
||||
extends Node
|
||||
|
||||
export var Duration = 7.5
|
||||
|
||||
func shuffleList(list):
|
||||
var shuffledList = []
|
||||
var indexList = range(list.size())
|
||||
for i in range(list.size()):
|
||||
var x = randi() % indexList.size()
|
||||
shuffledList.append(list[indexList[x]])
|
||||
indexList.remove(x)
|
||||
return shuffledList
|
||||
|
||||
func ConfusionRoutine(player, delta):
|
||||
var elapsed = 0
|
||||
var inputs = player.baseInputs
|
||||
player.inputs = shuffleList(inputs)
|
||||
while elapsed < Duration:
|
||||
elapsed += yield()
|
||||
player.inputs = player.baseInputs
|
||||
|
||||
func StartEffect(player):
|
||||
var rout = ConfusionRoutine(player, 0)
|
||||
return rout
|
@ -10,6 +10,16 @@ var curLife = MAX_LIFE
|
||||
|
||||
var coroutines = []
|
||||
|
||||
enum EInput{
|
||||
UP,
|
||||
RIGHT,
|
||||
DOWN,
|
||||
LEFT
|
||||
}
|
||||
|
||||
const baseInputs = ["ui_up", "ui_right", "ui_down", "ui_left"]
|
||||
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")
|
||||
@ -25,11 +35,11 @@ func _physics_process(delta):
|
||||
var input_vector = Vector2.ZERO
|
||||
|
||||
if self.name == "Player1":
|
||||
input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
|
||||
input_vector.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
|
||||
input_vector.x = Input.get_action_strength(inputs[EInput.RIGHT]) - Input.get_action_strength(inputs[EInput.LEFT])
|
||||
input_vector.y = Input.get_action_strength(inputs[EInput.DOWN]) - Input.get_action_strength(inputs[EInput.UP])
|
||||
elif self.name == "Player2":
|
||||
input_vector.x = Input.get_action_strength("ui_right2") - Input.get_action_strength("ui_left2")
|
||||
input_vector.y = Input.get_action_strength("ui_down2") - Input.get_action_strength("ui_up2")
|
||||
input_vector.x = Input.get_action_strength(inputs[EInput.RIGHT] + "2") - Input.get_action_strength(inputs[EInput.LEFT] + "2")
|
||||
input_vector.y = Input.get_action_strength(inputs[EInput.DOWN] + "2") - Input.get_action_strength(inputs[EInput.UP] + "2")
|
||||
|
||||
input_vector = input_vector.normalized()
|
||||
|
||||
|
@ -21,10 +21,10 @@ config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=320
|
||||
window/size/height=180
|
||||
window/size/test_width=1280
|
||||
window/size/test_height=720
|
||||
window/size/width=1920
|
||||
window/size/height=1080
|
||||
window/size/test_width=1920
|
||||
window/size/test_height=1080
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user