Add prototype
This commit is contained in:
parent
32b1e33a4b
commit
02c2d9bc42
14 changed files with 265 additions and 0 deletions
BIN
Assets/tmp.png
(Stored with Git LFS)
Executable file
BIN
Assets/tmp.png
(Stored with Git LFS)
Executable file
Binary file not shown.
35
Assets/tmp.png.import
Executable file
35
Assets/tmp.png.import
Executable file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/tmp.png-82d4b422f3667f5c47d6988a92ccd2a3.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/tmp.png"
|
||||
dest_files=[ "res://.import/tmp.png-82d4b422f3667f5c47d6988a92ccd2a3.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
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
Assets/tmp1.png
(Stored with Git LFS)
Executable file
BIN
Assets/tmp1.png
(Stored with Git LFS)
Executable file
Binary file not shown.
35
Assets/tmp1.png.import
Executable file
35
Assets/tmp1.png.import
Executable file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/tmp1.png-0c1a3d9d3390acb57bea785b3f9e30f7.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/tmp1.png"
|
||||
dest_files=[ "res://.import/tmp1.png-0c1a3d9d3390acb57bea785b3f9e30f7.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
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
Assets/tmp2.png
(Stored with Git LFS)
Executable file
BIN
Assets/tmp2.png
(Stored with Git LFS)
Executable file
Binary file not shown.
35
Assets/tmp2.png.import
Executable file
35
Assets/tmp2.png.import
Executable file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/tmp2.png-ed8b7dcf1a8f661b4546e218d233b408.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/tmp2.png"
|
||||
dest_files=[ "res://.import/tmp2.png-ed8b7dcf1a8f661b4546e218d233b408.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
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
BIN
Assets/tmp3.png
(Stored with Git LFS)
Executable file
BIN
Assets/tmp3.png
(Stored with Git LFS)
Executable file
Binary file not shown.
35
Assets/tmp3.png.import
Executable file
35
Assets/tmp3.png.import
Executable file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/tmp3.png-0afe8b1e9c47be51c701b0d537c4b45a.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/tmp3.png"
|
||||
dest_files=[ "res://.import/tmp3.png-0afe8b1e9c47be51c701b0d537c4b45a.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
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
10
Characters/Player.tscn
Executable file
10
Characters/Player.tscn
Executable file
|
@ -0,0 +1,10 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Assets/tmp.png" type="Texture" id=1]
|
||||
|
||||
[node name="Player" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
scale = Vector2( 3.34375, 3.03125 )
|
||||
texture = ExtResource( 1 )
|
33
Characters/Villain.gd
Executable file
33
Characters/Villain.gd
Executable file
|
@ -0,0 +1,33 @@
|
|||
extends Node2D
|
||||
|
||||
onready var me = $AnimatedSprite
|
||||
|
||||
onready var timer
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
timer = 0
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
timer += delta
|
||||
match me.get_frame():
|
||||
0:
|
||||
# Vert
|
||||
if timer >= 5:
|
||||
timer = 0
|
||||
me.set_frame(1)
|
||||
1:
|
||||
# Orange
|
||||
if timer >= .5:
|
||||
timer = 0
|
||||
me.set_frame(2)
|
||||
2:
|
||||
# Rouge
|
||||
if timer >= 2:
|
||||
timer = 0
|
||||
me.set_frame(0)
|
||||
_:
|
||||
print("Not handled frame")
|
21
Characters/Villain.tscn
Executable file
21
Characters/Villain.tscn
Executable file
|
@ -0,0 +1,21 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://Assets/tmp1.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Assets/tmp3.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Assets/tmp2.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Characters/Villain.gd" type="Script" id=4]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 1 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[node name="Villain" type="Node2D"]
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
scale = Vector2( 5, 5 )
|
||||
frames = SubResource( 1 )
|
21
Scenes/Button_Node2D.gd
Executable file
21
Scenes/Button_Node2D.gd
Executable file
|
@ -0,0 +1,21 @@
|
|||
extends Button
|
||||
|
||||
onready var villain = $"../Villain/AnimatedSprite"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
|
||||
|
||||
func _on_Button_pressed():
|
||||
match villain.get_frame():
|
||||
2:
|
||||
print("non")
|
||||
_:
|
||||
print("oui")
|
27
Scenes/Node2D.tscn
Executable file
27
Scenes/Node2D.tscn
Executable file
|
@ -0,0 +1,27 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Characters/Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Characters/Villain.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Scenes/Button_Node2D.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="Theme" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 719, 386 )
|
||||
script = null
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
margin_left = 654.0
|
||||
margin_top = 288.0
|
||||
margin_right = 784.0
|
||||
margin_bottom = 322.0
|
||||
theme = SubResource( 1 )
|
||||
text = "CLIQUE MOI"
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="Villain" parent="." instance=ExtResource( 2 )]
|
||||
position = Vector2( 276, 189 )
|
||||
|
||||
[connection signal="pressed" from="Button" to="Button" method="_on_Button_pressed"]
|
|
@ -11,6 +11,7 @@ config_version=4
|
|||
[application]
|
||||
|
||||
config/name="Gja"
|
||||
run/main_scene="res://Scenes/Node2D.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[gui]
|
||||
|
|
Reference in a new issue