diff --git a/core/Cursor.tscn b/core/Cursor.tscn new file mode 100644 index 0000000..205833f --- /dev/null +++ b/core/Cursor.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=4 format=3 uid="uid://524sv8spw6go"] + +[ext_resource type="Texture2D" uid="uid://docoki1q4vvfh" path="res://textures/atlas/SPRT_Hand.png" id="1_va1hk"] + +[sub_resource type="GDScript" id="GDScript_h2l04"] +script/source = "extends Node2D + +const Speed:float = 900 + +# 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): + var mouse = get_viewport().get_mouse_position() + var old_pos + if (mouse != old_pos): + position = mouse + old_pos = position +" + +[sub_resource type="AtlasTexture" id="AtlasTexture_n2i6f"] +atlas = ExtResource("1_va1hk") +region = Rect2(0, 0, 256, 256) + +[node name="Cursor" type="Node2D"] +top_level = true +script = SubResource("GDScript_h2l04") + +[node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(0.5, 0.5) +texture = SubResource("AtlasTexture_n2i6f") +centered = false +offset = Vector2(-23.615, -235.42) diff --git a/core/sceneInstance.gd b/core/sceneInstance.gd index e61b1ff..4e3cbf1 100644 --- a/core/sceneInstance.gd +++ b/core/sceneInstance.gd @@ -1,5 +1,7 @@ extends Node2D + + @export var InitialPlayer :PackedScene @export var InitialMap :PackedScene @@ -20,7 +22,7 @@ func transition_to_scene(new_scene: PackedScene, spawn_location = Vector2(0,0), player = $CurrentScene.find_child("player",true) if (player): player.teleport(spawn_location, spawn_direction) - else: + else: #Spawn the player if there is none if (InitialPlayer): player = InitialPlayer.instantiate() player.set_name("player") @@ -31,3 +33,4 @@ func transition_to_scene(new_scene: PackedScene, spawn_location = Vector2(0,0), func _on_ready(): transition_to_scene(InitialMap,Vector2(0,0),1) + Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) diff --git a/project.godot b/project.godot index 8745515..ff9f02f 100644 --- a/project.godot +++ b/project.godot @@ -76,6 +76,26 @@ menu={ , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null) ] } +mouse_up={ +"deadzone": 0.5, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null) +] +} +mouse_down={ +"deadzone": 0.5, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) +] +} +mouse_left={ +"deadzone": 0.5, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null) +] +} +mouse_right={ +"deadzone": 0.5, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null) +] +} [layer_names] diff --git a/extracted/Texture2D/SPRT_Hand.png b/textures/atlas/SPRT_Hand.png similarity index 100% rename from extracted/Texture2D/SPRT_Hand.png rename to textures/atlas/SPRT_Hand.png diff --git a/extracted/Texture2D/SPRT_Hand.png.import b/textures/atlas/SPRT_Hand.png.import similarity index 71% rename from extracted/Texture2D/SPRT_Hand.png.import rename to textures/atlas/SPRT_Hand.png.import index 8930e26..b106d00 100644 --- a/extracted/Texture2D/SPRT_Hand.png.import +++ b/textures/atlas/SPRT_Hand.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://docoki1q4vvfh" -path="res://.godot/imported/SPRT_Hand.png-10f10cc13ae4b0331523734719309ebe.ctex" +path="res://.godot/imported/SPRT_Hand.png-f682339cd646a6350ee80c8d3fc09b3b.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://extracted/Texture2D/SPRT_Hand.png" -dest_files=["res://.godot/imported/SPRT_Hand.png-10f10cc13ae4b0331523734719309ebe.ctex"] +source_file="res://textures/atlas/SPRT_Hand.png" +dest_files=["res://.godot/imported/SPRT_Hand.png-f682339cd646a6350ee80c8d3fc09b3b.ctex"] [params]