blob: 3ad77322c8eba0609748f2103ca98bb452ab5032 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
class_name Player
extends Node3D
const PLAYER_SIZE: float = 0.4
const SPEED: float = 25.
var mesh = preload("res://scenes/player.tscn").instantiate()
func _init(id: int, new_name: String, pos: Vector2, _character: int):
add_child(mesh)
position = Vector3(pos.x, 0, pos.y)
name = new_name
func update_position(new_position: Vector2, new_rotation: float):
position = Vector3(new_position.x, 0, new_position.y)
rotation.y = new_rotation
|