Created a basic start to a virtual mouse
This commit is contained in:
13
Assets/components/VirtualMouse.gd
Normal file
13
Assets/components/VirtualMouse.gd
Normal 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)
|
||||
23
Assets/components/VirtualMouse.tscn
Normal file
23
Assets/components/VirtualMouse.tscn
Normal 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")
|
||||
Reference in New Issue
Block a user