Created a basic start to a virtual mouse

This commit is contained in:
2024-08-15 02:06:49 -05:00
parent 8a000a0533
commit ac6befea9c
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,13 @@
extends RigidBody2D
@export_range(0,50,.1) var Cursor_Speed:float = 1
# 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 movement = Input.get_vector("move_left","move_right","move_forward", "move_back")
move_and_collide(movement * Cursor_Speed)

View File

@ -0,0 +1,23 @@
[gd_scene load_steps=5 format=3 uid="uid://c28lfuuvc52i7"]
[ext_resource type="Script" path="res://Assets/components/VirtualMouse.gd" id="1_bd173"]
[sub_resource type="CircleShape2D" id="CircleShape2D_o7nr5"]
[sub_resource type="SphereMesh" id="SphereMesh_1cxl3"]
[sub_resource type="ImageTexture" id="ImageTexture_2l327"]
[node name="Control" type="RigidBody2D"]
gravity_scale = 0.0
script = ExtResource("1_bd173")
Cursor_Speed = 10.7
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_o7nr5")
[node name="MeshInstance2D" type="MeshInstance2D" parent="."]
position = Vector2(4.76837e-07, 4.76837e-07)
scale = Vector2(20.5238, 20.5018)
mesh = SubResource("SphereMesh_1cxl3")
texture = SubResource("ImageTexture_2l327")