separate player "model"

This commit is contained in:
mehbark 2025-05-01 14:03:23 -04:00
parent db311c2a62
commit 1d0a7f7bef
2 changed files with 10 additions and 1 deletions

View file

@ -15,6 +15,7 @@ var states: Array[State] = [State.from_string(microban_1)]
const WALL = preload("res://wall.tres")
const GOAL = preload("res://goal.tres")
const BOX = preload("res://box.tres")
const PLAYER = preload("res://player.tres")
@onready var board: Node3D = $Board
@ -38,7 +39,8 @@ func render() -> void:
var pos := Vector2i(x, y)
if state.goal_at(pos): add_mesh(pos, GOAL)
if state.box_at(pos): add_mesh(pos, BOX)
if state.wall_at(pos) or pos == state.player_pos: add_mesh(pos, WALL)
if state.wall_at(pos): add_mesh(pos, WALL)
if pos == state.player_pos: add_mesh(pos, PLAYER)
func _input(event: InputEvent) -> void:
if event.is_action_pressed("u"):

7
player.tres Normal file
View file

@ -0,0 +1,7 @@
[gd_resource type="CapsuleMesh" load_steps=2 format=3 uid="uid://mjvk342gmemc"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8tqic"]
albedo_color = Color(0.51788, 0.672061, 0.871029, 1)
[resource]
material = SubResource("StandardMaterial3D_8tqic")