From 40a9b7b7fb7d6e0312ae610b527d18fb2d708ba7 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Mon, 12 Sep 2022 02:11:27 -0400 Subject: Decouple ViewModel and the BaseCharacter The ViewModel now consists of the camera, controls, and character driving logic. The actual character model has been removed and is expected to be externally present in the scene. An exported variable is added to reference the player object that the view model is to be controlling. This will allow us to place multiple characters in a scene and change the view model's perspective on the fly. Both of the current maps have been updated to implement this properly, and add an extra character on the enemy team. Signed-off-by: Malfurious --- assets/maps/misc/dev_plane/DevPlane.tscn | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'assets/maps/misc/dev_plane/DevPlane.tscn') diff --git a/assets/maps/misc/dev_plane/DevPlane.tscn b/assets/maps/misc/dev_plane/DevPlane.tscn index a17a112..5134d2e 100644 --- a/assets/maps/misc/dev_plane/DevPlane.tscn +++ b/assets/maps/misc/dev_plane/DevPlane.tscn @@ -1,7 +1,9 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://assets/maps/misc/dev_plane/tile_color.png" type="Texture" id=1] [ext_resource path="res://assets/view_model/ViewModel.tscn" type="PackedScene" id=2] +[ext_resource path="res://assets/characters/base_character/BaseCharacter.tscn" type="PackedScene" id=3] +[ext_resource path="res://assets/characters/base_character/enemy_material.tres" type="Material" id=4] [sub_resource type="SpatialMaterial" id=6] albedo_texture = ExtResource( 1 ) @@ -25,14 +27,21 @@ material = SubResource( 3 ) [node name="DevPlane" type="Spatial"] +[node name="ViewModel" parent="." instance=ExtResource( 2 )] +character = NodePath("../FriendlyPlayer") + +[node name="FriendlyPlayer" parent="." groups=["players"] instance=ExtResource( 3 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, 12 ) + +[node name="EnemyPlayer" parent="." groups=["players"] instance=ExtResource( 3 )] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0.75, -12 ) +material = ExtResource( 4 ) + [node name="DirectionalLight" type="DirectionalLight" parent="."] transform = Transform( -4.37114e-08, -0.292372, 0.956305, 0, 0.956305, 0.292372, -1, 1.278e-08, -4.18014e-08, 0, 10, 0 ) shadow_enabled = true directional_shadow_blend_splits = true -[node name="ViewModel" parent="." instance=ExtResource( 2 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 12 ) - [node name="Geometry" type="Spatial" parent="."] [node name="Floor" type="StaticBody" parent="Geometry"] -- cgit v1.2.3