- git init
This commit is contained in:
commit
78d62d0173
394 changed files with 8494 additions and 0 deletions
15
Scenen/falle.tscn
Normal file
15
Scenen/falle.tscn
Normal file
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://b5eir3bdtnwq1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b3gdy01ed75be" path="res://assets/shared image.png" id="1_3nrv2"]
|
||||
|
||||
[node name="Falle" type="Area2D" groups=["die"]]
|
||||
|
||||
[node name="SharedImage" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_3nrv2")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(80, 112, 16, 16)
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
polygon = PackedVector2Array(8, -6, 4, 8, -4, 8, -7, -7, 1, -7)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
269
Scenen/main.tscn
Normal file
269
Scenen/main.tscn
Normal file
|
@ -0,0 +1,269 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://c86ulxln7qgny"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c3jqll3p5a05o" path="res://assets/background.png" id="1_d32q7"]
|
||||
[ext_resource type="PackedScene" uid="uid://dhuh1n0g2rt0a" path="res://Scenen/player.tscn" id="2_4n11t"]
|
||||
[ext_resource type="PackedScene" uid="uid://diikmjicgreq5" path="res://Scenen/plattform.tscn" id="3_vfoci"]
|
||||
[ext_resource type="PackedScene" uid="uid://b5eir3bdtnwq1" path="res://Scenen/falle.tscn" id="4_cyf6p"]
|
||||
[ext_resource type="PackedScene" uid="uid://dm6q0abakck7u" path="res://Scenen/stick/joystick.tscn" id="5_auvtg"]
|
||||
[ext_resource type="Texture2D" uid="uid://ccqr58ca2ldhc" path="res://assets/Free/Menu/Buttons/Play.png" id="6_3ocor"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rr7jo"]
|
||||
size = Vector2(2997, 47)
|
||||
|
||||
[node name="main" type="Node2D"]
|
||||
position = Vector2(-1, -26)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Background" type="TextureRect" parent="."]
|
||||
offset_left = -861.0
|
||||
offset_top = -978.0
|
||||
offset_right = 1699.0
|
||||
offset_bottom = 1216.0
|
||||
texture = ExtResource("1_d32q7")
|
||||
stretch_mode = 1
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Charakter" parent="." instance=ExtResource("2_4n11t")]
|
||||
position = Vector2(-17, 52)
|
||||
|
||||
[node name="Sterben" type="Area2D" parent="." groups=["die"]]
|
||||
position = Vector2(76, 231)
|
||||
|
||||
[node name="augen" type="CollisionShape2D" parent="Sterben"]
|
||||
shape = SubResource("RectangleShape2D_rr7jo")
|
||||
debug_color = Color(0.79976, 0.382204, 0.473197, 0.42)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Sterben2" type="Area2D" parent="." groups=["die"]]
|
||||
position = Vector2(456, -804)
|
||||
|
||||
[node name="augen" type="CollisionShape2D" parent="Sterben2"]
|
||||
shape = SubResource("RectangleShape2D_rr7jo")
|
||||
debug_color = Color(0.79976, 0.382204, 0.473197, 0.42)
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="RespawnMarker" type="Marker2D" parent="."]
|
||||
position = Vector2(1, 31)
|
||||
|
||||
[node name="Plattformen" type="Node2D" parent="."]
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Plattform2" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(10, 104)
|
||||
|
||||
[node name="Plattform4" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(166, 81)
|
||||
|
||||
[node name="Plattform5" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(313, 46)
|
||||
|
||||
[node name="Plattform6" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(154, -13)
|
||||
|
||||
[node name="Plattform7" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(-5, -24)
|
||||
|
||||
[node name="Plattform8" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(-162, -57)
|
||||
|
||||
[node name="Plattform3" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(759, -751)
|
||||
|
||||
[node name="Plattform25" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(915, -774)
|
||||
|
||||
[node name="Plattform26" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(1062, -809)
|
||||
|
||||
[node name="Plattform27" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(903, -868)
|
||||
|
||||
[node name="Plattform28" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(744, -879)
|
||||
|
||||
[node name="Plattform29" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(587, -912)
|
||||
|
||||
[node name="Plattform9" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(2, -126)
|
||||
|
||||
[node name="Plattform10" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(177, -130)
|
||||
|
||||
[node name="Plattform11" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(364, -155)
|
||||
|
||||
[node name="Plattform12" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(503, -186)
|
||||
|
||||
[node name="Plattform13" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(399, -271)
|
||||
|
||||
[node name="Plattform14" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(220, -293)
|
||||
|
||||
[node name="Plattform15" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(65, -328)
|
||||
|
||||
[node name="Plattform16" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(242, -384)
|
||||
|
||||
[node name="Plattform17" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(402, -418)
|
||||
|
||||
[node name="Plattform18" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(520, -457)
|
||||
|
||||
[node name="Plattform19" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(388, -529)
|
||||
|
||||
[node name="Plattform20" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(255, -553)
|
||||
|
||||
[node name="Plattform21" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(108, -591)
|
||||
|
||||
[node name="Plattform22" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(280, -641)
|
||||
|
||||
[node name="Plattform23" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(454, -675)
|
||||
|
||||
[node name="Plattform24" parent="Plattformen" instance=ExtResource("3_vfoci")]
|
||||
position = Vector2(615, -703)
|
||||
|
||||
[node name="Fallen" type="Node2D" parent="."]
|
||||
position = Vector2(-17, 52)
|
||||
|
||||
[node name="Falle" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(185, 4)
|
||||
|
||||
[node name="Falle2" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(358, -32)
|
||||
|
||||
[node name="Falle3" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(149, -90)
|
||||
|
||||
[node name="Falle4" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(6, -100)
|
||||
|
||||
[node name="Falle5" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(-183, -135)
|
||||
|
||||
[node name="Falle6" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(193, -208)
|
||||
|
||||
[node name="Falle7" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(364, -233)
|
||||
|
||||
[node name="Falle8" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(384, -233)
|
||||
|
||||
[node name="Falle9" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(44, -407)
|
||||
|
||||
[node name="Falle10" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(262, -461)
|
||||
|
||||
[node name="Falle11" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(399, -496)
|
||||
|
||||
[node name="Falle12" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(413, -495)
|
||||
|
||||
[node name="Falle13" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(430, -494)
|
||||
|
||||
[node name="Falle14" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(569, -534)
|
||||
|
||||
[node name="Falle15" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(399, -608)
|
||||
|
||||
[node name="Falle16" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(333, -717)
|
||||
|
||||
[node name="Falle17" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(457, -754)
|
||||
|
||||
[node name="Falle18" parent="Fallen" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(474, -754)
|
||||
|
||||
[node name="Fallen2" type="Node2D" parent="."]
|
||||
position = Vector2(732, -803)
|
||||
|
||||
[node name="Falle" parent="Fallen2" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(185, 4)
|
||||
|
||||
[node name="Falle2" parent="Fallen2" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(358, -32)
|
||||
|
||||
[node name="Falle3" parent="Fallen2" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(149, -90)
|
||||
|
||||
[node name="Falle4" parent="Fallen2" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(6, -100)
|
||||
|
||||
[node name="Falle5" parent="Fallen2" instance=ExtResource("4_cyf6p")]
|
||||
position = Vector2(-183, -135)
|
||||
|
||||
[node name="Control" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="left" type="Control" parent="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -40.0
|
||||
offset_right = 40.0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="Joystick" parent="Control/left" instance=ExtResource("5_auvtg")]
|
||||
position = Vector2(196, -125)
|
||||
scale = Vector2(3, 3)
|
||||
|
||||
[node name="right" type="Control" parent="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -40.0
|
||||
offset_top = -40.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="jumpbutton" type="TouchScreenButton" parent="Control/right"]
|
||||
position = Vector2(-214, -0.999996)
|
||||
rotation = -1.5708
|
||||
scale = Vector2(10, 10)
|
||||
texture_normal = ExtResource("6_3ocor")
|
||||
visibility_mode = 1
|
||||
|
||||
[connection signal="body_entered" from="Sterben" to="Sterben" method="_on_body_entered"]
|
||||
[connection signal="body_entered" from="Sterben2" to="Sterben2" method="_on_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle2" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle3" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle4" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle5" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle6" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle7" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle8" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle9" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle10" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle11" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle12" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle13" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle14" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle15" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle16" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle17" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen/Falle18" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen2/Falle" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen2/Falle2" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen2/Falle3" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen2/Falle4" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="body_entered" from="Fallen2/Falle5" to="Charakter" method="_on_falle_body_entered"]
|
||||
[connection signal="pressed" from="Control/right/jumpbutton" to="Charakter" method="jump"]
|
14
Scenen/menu.gd
Normal file
14
Scenen/menu.gd
Normal file
|
@ -0,0 +1,14 @@
|
|||
extends Control
|
||||
|
||||
|
||||
func _on_play_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://Scenen/main.tscn")
|
||||
|
||||
|
||||
func _on_volume_toggled(toggled_on: bool) -> void:
|
||||
AudioServer.set_bus_mute(0,toggled_on)
|
||||
if toggled_on:
|
||||
$Liste/Buttons/Volume.texture_normal = preload("res://assets/Free/Menu/Buttons/Volume_mute.png")
|
||||
else:
|
||||
$Liste/Buttons/Volume.texture_normal = preload("res://assets/Free/Menu/Buttons/Volume.png")
|
||||
|
87
Scenen/menu.tscn
Normal file
87
Scenen/menu.tscn
Normal file
|
@ -0,0 +1,87 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://dpawirk1fo3t6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ixpjprk0djce" path="res://man-run-splash.png" id="1_4f0si"]
|
||||
[ext_resource type="Script" path="res://Scenen/menu.gd" id="1_qniwe"]
|
||||
[ext_resource type="Texture2D" uid="uid://ccqr58ca2ldhc" path="res://assets/Free/Menu/Buttons/Play.png" id="2_m2mcb"]
|
||||
[ext_resource type="Texture2D" uid="uid://cpdr1pi20ojdk" path="res://assets/Free/Background/Brown.png" id="2_niirg"]
|
||||
[ext_resource type="Texture2D" uid="uid://by2vq318bo1cc" path="res://assets/Free/Menu/Buttons/Settings.png" id="3_5lxj3"]
|
||||
[ext_resource type="Texture2D" uid="uid://cwpnfio8yt280" path="res://assets/Free/Menu/Buttons/Volume.png" id="4_tv54d"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnyejhxumad1n" path="res://assets/Free/Menu/Buttons/Volume_mute.png" id="7_ca6b7"]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_qniwe")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
texture = ExtResource("2_niirg")
|
||||
stretch_mode = 1
|
||||
|
||||
[node name="Bild" type="TextureRect" parent="."]
|
||||
clip_contents = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 6
|
||||
anchor_left = 1.0
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -864.0
|
||||
offset_top = -324.0
|
||||
offset_bottom = 324.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_4f0si")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="Liste" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Buttons" type="VBoxContainer" parent="Liste"]
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="Play" type="TextureButton" parent="Liste/Buttons"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture_normal = ExtResource("2_m2mcb")
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="Settings" type="TextureButton" parent="Liste/Buttons"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture_normal = ExtResource("3_5lxj3")
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="Volume" type="TextureButton" parent="Liste/Buttons"]
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
texture_normal = ExtResource("4_tv54d")
|
||||
texture_disabled = ExtResource("7_ca6b7")
|
||||
stretch_mode = 4
|
||||
|
||||
[connection signal="pressed" from="Liste/Buttons/Play" to="." method="_on_play_pressed"]
|
||||
[connection signal="toggled" from="Liste/Buttons/Volume" to="." method="_on_volume_toggled"]
|
12
Scenen/musik.tscn
Normal file
12
Scenen/musik.tscn
Normal file
File diff suppressed because one or more lines are too long
17
Scenen/plattform.tscn
Normal file
17
Scenen/plattform.tscn
Normal file
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://diikmjicgreq5"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c68yu676n2ji3" path="res://assets/Free/Terrain/Terrain (16x16).png" id="1_as7fc"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nqesr"]
|
||||
size = Vector2(45.4101, 17.0587)
|
||||
|
||||
[node name="Plattform" type="StaticBody2D"]
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_as7fc")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(97, 0, 46, 19)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_nqesr")
|
30
Scenen/player.tscn
Normal file
30
Scenen/player.tscn
Normal file
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dhuh1n0g2rt0a"]
|
||||
|
||||
[ext_resource type="Script" path="res://code/player.gd" id="1_xj13o"]
|
||||
[ext_resource type="Texture2D" uid="uid://0gvmndoyr6do" path="res://assets/Ninja Frog/Idle (32x32).png" id="2_sbn23"]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_quhe5"]
|
||||
height = 24.0
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
script = ExtResource("1_xj13o")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
zoom = Vector2(2.5, 2.5)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_sbn23")
|
||||
hframes = 11
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 4)
|
||||
shape = SubResource("CapsuleShape2D_quhe5")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." groups=["die"]]
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Area2D"]
|
||||
position = Vector2(0, 4)
|
||||
shape = SubResource("CapsuleShape2D_quhe5")
|
||||
debug_color = Color(0.861615, 0.31579, 0.457849, 0.42)
|
||||
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
|
38
Scenen/stick/Knob.gd
Normal file
38
Scenen/stick/Knob.gd
Normal file
|
@ -0,0 +1,38 @@
|
|||
extends Sprite2D
|
||||
|
||||
@onready var parent = $".."
|
||||
|
||||
var pressing = false
|
||||
|
||||
@export var maxLength = 50
|
||||
var deadzone = 15
|
||||
|
||||
func _ready():
|
||||
deadzone = parent.deadzone
|
||||
maxLength *= parent.scale.x
|
||||
|
||||
func _process(delta):
|
||||
if pressing:
|
||||
if get_global_mouse_position().distance_to(parent.global_position) <= maxLength:
|
||||
global_position = get_global_mouse_position()
|
||||
else:
|
||||
var angle = parent.global_position.angle_to_point(get_global_mouse_position())
|
||||
global_position.x = parent.global_position.x + cos(angle)*maxLength
|
||||
global_position.y = parent.global_position.y + sin(angle)*maxLength
|
||||
calculateVector()
|
||||
else:
|
||||
global_position = lerp(global_position, parent.global_position, delta*50)
|
||||
parent.posVector = Vector2(0,0)
|
||||
|
||||
func calculateVector():
|
||||
if abs((global_position.x - parent.global_position.x)) >= deadzone:
|
||||
parent.posVector.x = (global_position.x - parent.global_position.x)/maxLength
|
||||
if abs((global_position.y - parent.global_position.y)) >= deadzone:
|
||||
parent.posVector.y = (global_position.y - parent.global_position.y)/maxLength
|
||||
|
||||
func _on_button_button_down():
|
||||
pressing = true
|
||||
|
||||
|
||||
func _on_button_button_up():
|
||||
pressing = false
|
BIN
Scenen/stick/joyknobpng.png
Normal file
BIN
Scenen/stick/joyknobpng.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
34
Scenen/stick/joyknobpng.png.import
Normal file
34
Scenen/stick/joyknobpng.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://hg42snfhm6ei"
|
||||
path="res://.godot/imported/joyknobpng.png-64c62ab708d1de033ab6f6d261cbeca6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenen/stick/joyknobpng.png"
|
||||
dest_files=["res://.godot/imported/joyknobpng.png-64c62ab708d1de033ab6f6d261cbeca6.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
Scenen/stick/joyring.png
Normal file
BIN
Scenen/stick/joyring.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
34
Scenen/stick/joyring.png.import
Normal file
34
Scenen/stick/joyring.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bidhxucp2kd66"
|
||||
path="res://.godot/imported/joyring.png-25c2137935002abe1d7560c543f467cb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Scenen/stick/joyring.png"
|
||||
dest_files=["res://.godot/imported/joyring.png-25c2137935002abe1d7560c543f467cb.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
8
Scenen/stick/joystick.gd
Normal file
8
Scenen/stick/joystick.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
extends Node2D
|
||||
|
||||
var posVector: Vector2
|
||||
@export var deadzone = 15
|
||||
|
||||
func _ready() -> void:
|
||||
if not DisplayServer.is_touchscreen_available():
|
||||
set_process(false)
|
27
Scenen/stick/joystick.tscn
Normal file
27
Scenen/stick/joystick.tscn
Normal file
|
@ -0,0 +1,27 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://dm6q0abakck7u"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scenen/stick/joystick.gd" id="1_ii2vn"]
|
||||
[ext_resource type="Texture2D" uid="uid://bidhxucp2kd66" path="res://Scenen/stick/joyring.png" id="2_w2jn3"]
|
||||
[ext_resource type="Texture2D" uid="uid://hg42snfhm6ei" path="res://Scenen/stick/joyknobpng.png" id="3_voruw"]
|
||||
[ext_resource type="Script" path="res://Scenen/stick/Knob.gd" id="4_g4kk1"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_wuxim"]
|
||||
size = Vector2(100, 100)
|
||||
|
||||
[node name="Joystick" type="Node2D"]
|
||||
script = ExtResource("1_ii2vn")
|
||||
|
||||
[node name="Ring" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.055, 0.055)
|
||||
texture = ExtResource("2_w2jn3")
|
||||
|
||||
[node name="Knob" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.02, 0.02)
|
||||
texture = ExtResource("3_voruw")
|
||||
script = ExtResource("4_g4kk1")
|
||||
|
||||
[node name="Button" type="TouchScreenButton" parent="."]
|
||||
shape = SubResource("RectangleShape2D_wuxim")
|
||||
|
||||
[connection signal="pressed" from="Button" to="Knob" method="_on_button_button_down"]
|
||||
[connection signal="released" from="Button" to="Knob" method="_on_button_button_up"]
|
Loading…
Add table
Add a link
Reference in a new issue