diff --git a/art/player/armless/PlayerArmless.aseprite b/art/player/armless/PlayerArmless.aseprite new file mode 100644 index 0000000..5efc3d3 Binary files /dev/null and b/art/player/armless/PlayerArmless.aseprite differ diff --git a/art/player/armless/PlayerArmless.png b/art/player/armless/PlayerArmless.png new file mode 100644 index 0000000..daaf62b Binary files /dev/null and b/art/player/armless/PlayerArmless.png differ diff --git a/art/player/armless/PlayerArmless.png.import b/art/player/armless/PlayerArmless.png.import new file mode 100644 index 0000000..afdb795 --- /dev/null +++ b/art/player/armless/PlayerArmless.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b5jsyliv8lppk" +path="res://.godot/imported/PlayerArmless.png-155875c28fbcca594a6ac1aafaba1fcc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/player/armless/PlayerArmless.png" +dest_files=["res://.godot/imported/PlayerArmless.png-155875c28fbcca594a6ac1aafaba1fcc.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 diff --git a/art/player/armless/botarm.aseprite b/art/player/armless/botarm.aseprite new file mode 100644 index 0000000..9c6635b Binary files /dev/null and b/art/player/armless/botarm.aseprite differ diff --git a/art/player/armless/botarm.png b/art/player/armless/botarm.png new file mode 100644 index 0000000..2b1d5ed Binary files /dev/null and b/art/player/armless/botarm.png differ diff --git a/art/player/armless/botarm.png.import b/art/player/armless/botarm.png.import new file mode 100644 index 0000000..7871d6d --- /dev/null +++ b/art/player/armless/botarm.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cftm2rdoikqc2" +path="res://.godot/imported/botarm.png-d0bb7a3fee372e1a424b5e575d1ee2cb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/player/armless/botarm.png" +dest_files=["res://.godot/imported/botarm.png-d0bb7a3fee372e1a424b5e575d1ee2cb.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 diff --git a/art/player/armless/toparm.aseprite b/art/player/armless/toparm.aseprite new file mode 100644 index 0000000..1d3d972 Binary files /dev/null and b/art/player/armless/toparm.aseprite differ diff --git a/art/player/armless/toparm.png b/art/player/armless/toparm.png new file mode 100644 index 0000000..73a648c Binary files /dev/null and b/art/player/armless/toparm.png differ diff --git a/art/player/armless/toparm.png.import b/art/player/armless/toparm.png.import new file mode 100644 index 0000000..50fdaa7 --- /dev/null +++ b/art/player/armless/toparm.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dmq4e1e1ty6x1" +path="res://.godot/imported/toparm.png-b0003d5d8add1187865aff116dcc91c8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/player/armless/toparm.png" +dest_files=["res://.godot/imported/toparm.png-b0003d5d8add1187865aff116dcc91c8.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 diff --git a/player.gd b/player.gd index 35d6fee..b5383c1 100644 --- a/player.gd +++ b/player.gd @@ -18,7 +18,7 @@ var move_dir :Vector2= Vector2.ZERO # Called when the node enters the scene tree for the first time. func _ready(): - $PlayerSprite.play("still") + pass func set_move_direction(dir): move_dir = dir @@ -50,12 +50,4 @@ func _input(event): "flick_down" ) - if flick.length_squared() != 0: - if heldFrisbee == null: - heldFrisbee = frisbee.instantiate() - $PlayerSprite/FrisbeeLocation.add_child(heldFrisbee) - $PlayerSprite.play("throw") - else: - $PlayerSprite.play("still") - $PlayerSprite/FrisbeeLocation.remove_child(heldFrisbee) - heldFrisbee = null + $PinJoint2D/RightJointElbow/RightArmBot.apply_impulse(flick*100) diff --git a/player.tscn b/player.tscn index 5b9a04a..a604798 100644 --- a/player.tscn +++ b/player.tscn @@ -1,63 +1,65 @@ -[gd_scene load_steps=10 format=3 uid="uid://btlutggxxokno"] +[gd_scene load_steps=7 format=3 uid="uid://btlutggxxokno"] [ext_resource type="Script" path="res://player.gd" id="1_8jh48"] -[ext_resource type="Texture2D" uid="uid://yfxicvvu3j1k" path="res://art/player/Player1.png" id="1_wikqw"] -[ext_resource type="Texture2D" uid="uid://ctik1n8vyproe" path="res://art/player/Player2.png" id="2_31x2h"] -[ext_resource type="Texture2D" uid="uid://c5jkrxnrk8s4y" path="res://art/player/Player3.png" id="3_xoeqj"] -[ext_resource type="Texture2D" uid="uid://bxg6vu3byvcfa" path="res://art/player/Player4.png" id="4_08rsg"] -[ext_resource type="Texture2D" uid="uid://dfia7yrc5ds2w" path="res://art/player/throw/PlayerThrow1.png" id="6_yjoir"] -[ext_resource type="Texture2D" uid="uid://isrtm6ip2y5a" path="res://art/player/throw/PlayerThrow2.png" id="7_qb6xx"] - -[sub_resource type="SpriteFrames" id="SpriteFrames_obpd0"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": ExtResource("1_wikqw") -}, { -"duration": 1.0, -"texture": ExtResource("2_31x2h") -}, { -"duration": 1.0, -"texture": ExtResource("3_xoeqj") -}, { -"duration": 1.0, -"texture": ExtResource("4_08rsg") -}], -"loop": true, -"name": &"still", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": ExtResource("6_yjoir") -}, { -"duration": 1.0, -"texture": ExtResource("7_qb6xx") -}], -"loop": true, -"name": &"throw", -"speed": 5.0 -}] +[ext_resource type="Texture2D" uid="uid://b5jsyliv8lppk" path="res://art/player/armless/PlayerArmless.png" id="2_2ok64"] +[ext_resource type="Texture2D" uid="uid://dmq4e1e1ty6x1" path="res://art/player/armless/toparm.png" id="3_gbp6t"] +[ext_resource type="Texture2D" uid="uid://cftm2rdoikqc2" path="res://art/player/armless/botarm.png" id="4_fekg0"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_m60wa"] -size = Vector2(27.5, 48) +size = Vector2(22, 48) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_1uecq"] +size = Vector2(6, 10) [node name="Player" type="CharacterBody2D"] +collision_layer = 2 +collision_mask = 2 script = ExtResource("1_8jh48") -[node name="PlayerSprite" type="AnimatedSprite2D" parent="."] +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(-1, -24) +shape = SubResource("RectangleShape2D_m60wa") + +[node name="PlayerSprite" type="Sprite2D" parent="."] texture_filter = 1 position = Vector2(0, -24) scale = Vector2(2, 2) -sprite_frames = SubResource("SpriteFrames_obpd0") -animation = &"throw" -frame = 1 -frame_progress = 0.593015 +texture = ExtResource("2_2ok64") -[node name="FrisbeeLocation" type="Node2D" parent="PlayerSprite"] -position = Vector2(-0.5, 2.5) +[node name="PinJoint2D" type="PinJoint2D" parent="."] +position = Vector2(6, -30) +node_a = NodePath("..") +node_b = NodePath("RightArmTop") +bias = 0.9 -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -z_index = -1 -position = Vector2(0.25, -24) -shape = SubResource("RectangleShape2D_m60wa") +[node name="RightArmTop" type="RigidBody2D" parent="PinJoint2D"] +position = Vector2(3, 4) + +[node name="RightArmTopSp" type="Sprite2D" parent="PinJoint2D/RightArmTop"] +texture_filter = 1 +position = Vector2(0, 1) +scale = Vector2(2, 2) +texture = ExtResource("3_gbp6t") + +[node name="RightArmTopCol" type="CollisionShape2D" parent="PinJoint2D/RightArmTop"] +position = Vector2(0, 1) +shape = SubResource("RectangleShape2D_1uecq") + +[node name="RightJointElbow" type="PinJoint2D" parent="PinJoint2D"] +position = Vector2(3, 7) +node_a = NodePath("../RightArmTop") +node_b = NodePath("RightArmBot") +bias = 0.9 + +[node name="RightArmBot" type="RigidBody2D" parent="PinJoint2D/RightJointElbow"] +position = Vector2(3, 4) + +[node name="RightArmBotSp" type="Sprite2D" parent="PinJoint2D/RightJointElbow/RightArmBot"] +texture_filter = 1 +position = Vector2(-3, 1) +scale = Vector2(2, 2) +texture = ExtResource("4_fekg0") + +[node name="RightArmBotCol" type="CollisionShape2D" parent="PinJoint2D/RightJointElbow/RightArmBot"] +position = Vector2(-3, 1) +shape = SubResource("RectangleShape2D_1uecq")