From 6e87ca3b094cd239b4d8a39fafcdfc76d165763f Mon Sep 17 00:00:00 2001 From: Zac Date: Thu, 9 Aug 2018 01:10:04 -0400 Subject: [PATCH] added testing npc sprite added static npc scene added static npc into world --- images/troll.png | Bin 0 -> 451 bytes images/troll.png.import | 29 +++++++++++++++++++++ scenes/NPC_static.tscn | 54 ++++++++++++++++++++++++++++++++++++++++ scenes/Player.tscn | 10 ++++---- scenes/World.tscn | 13 +++++++--- 5 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 images/troll.png create mode 100644 images/troll.png.import create mode 100644 scenes/NPC_static.tscn diff --git a/images/troll.png b/images/troll.png new file mode 100644 index 0000000000000000000000000000000000000000..528ff1b731e9743fdce372d06a72da263458fd3b GIT binary patch literal 451 zcmeAS@N?(olHy`uVBq!ia0vp^AAmT3gAGWkd;X|lU|{U>ba4!+xb^ndM&2d|hPI2@ z5=V|4V!d;aQzs*)@y3mtH*W1{^M1q-Q+TLS=6UtWcp<&U^@=SU&PYVQ-Byt%(A?m7 zKp`QW&5%Rl*}fm|ua|DpXOc8te`KcP0VXy^ZV48h1R%<=cyMywbmwbJ?}Z=WhyZF} zY;IuXVG=W7>eDMPPl17w~6NTtFx zL(>PU3!m@1mh1wzNx;BFCfhfDI?!mS-9WX9malHe#ZEVYSP2!6(0wJe--Ann1>^{b zHOhySUi%+ES>&z@axvHvpefGE8}GFxPCd$WPIfDj8-YHP>az;@BKoWD-uZb*5-dC| zst2F;g#!HuGlE;9i)D@#(0Z8vbP`U;edTx3D&&VLVPgTe~DWM4f$jO<@ literal 0 HcmV?d00001 diff --git a/images/troll.png.import b/images/troll.png.import new file mode 100644 index 0000000..599b028 --- /dev/null +++ b/images/troll.png.import @@ -0,0 +1,29 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/troll.png-0a30c7e800ebe25e80a239ff95c35c74.stex" + +[deps] + +source_file="res://images/troll.png" +dest_files=[ "res://.import/troll.png-0a30c7e800ebe25e80a239ff95c35c74.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/NPC_static.tscn b/scenes/NPC_static.tscn new file mode 100644 index 0000000..0303880 --- /dev/null +++ b/scenes/NPC_static.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://images/troll.png" type="Texture" id=1] + +[sub_resource type="RectangleShape2D" id=1] + +custom_solver_bias = 0.0 +extents = Vector2( 29.9994, 40.5807 ) + +[sub_resource type="RectangleShape2D" id=2] + +custom_solver_bias = 0.0 +extents = Vector2( 60.0752, 66.6499 ) + +[node name="NPC" type="StaticBody2D" index="0"] + +input_pickable = false +collision_layer = 4 +collision_mask = 11 +constant_linear_velocity = Vector2( 0, 0 ) +constant_angular_velocity = 0.0 +friction = 1.0 +bounce = 0.0 + +[node name="npc_collision" type="CollisionShape2D" parent="." index="0"] + +scale = Vector2( 0.4, 0.4 ) +shape = SubResource( 1 ) + +[node name="interact_area" type="Area2D" parent="." index="1"] + +editor/display_folded = true +scale = Vector2( 0.4, 0.4 ) +input_pickable = true +gravity_vec = Vector2( 0, 1 ) +gravity = 98.0 +linear_damp = 0.1 +angular_damp = 1.0 +collision_layer = 4 +audio_bus_override = false +audio_bus_name = "Master" +_sections_unfolded = [ "Collision" ] + +[node name="interact_collision" type="CollisionShape2D" parent="interact_area" index="0"] + +shape = SubResource( 2 ) + +[node name="Sprite" type="Sprite" parent="." index="2"] + +scale = Vector2( 0.4, 0.4 ) +texture = ExtResource( 1 ) +hframes = 3 + + diff --git a/scenes/Player.tscn b/scenes/Player.tscn index 01eddb3..8c653ee 100644 --- a/scenes/Player.tscn +++ b/scenes/Player.tscn @@ -45,13 +45,13 @@ smoothing_enabled = true smoothing_speed = 5.0 offset_v = 0.0 offset_h = 0.0 -drag_margin_left = 0.2 -drag_margin_top = 0.2 -drag_margin_right = 0.2 -drag_margin_bottom = 0.2 +drag_margin_left = 0.15 +drag_margin_top = 0.15 +drag_margin_right = 0.15 +drag_margin_bottom = 0.15 editor_draw_screen = true editor_draw_limits = true editor_draw_drag_margin = true -_sections_unfolded = [ "Editor", "Smoothing" ] +_sections_unfolded = [ "Drag Margin" ] diff --git a/scenes/World.tscn b/scenes/World.tscn index fb90228..373f047 100644 --- a/scenes/World.tscn +++ b/scenes/World.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://resources/tiles.res" type="TileSet" id=1] -[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://scenes/NPC_static.tscn" type="PackedScene" id=2] +[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=3] [node name="World" type="Node2D" index="0"] @@ -50,7 +51,13 @@ format = 1 tile_data = PoolIntArray( -131073, 1, 0, -196608, 1, 0, -196607, 1, 0, -196606, 1, 0, -196605, 1, 0, -196604, 1, 0, -196603, 1, 0, -196602, 1, 0, -196601, 1, 0, -196600, 1, 0, -65537, 1, 0, -131072, 1, 0, -131064, 1, 0, -3, 1, 0, -2, 1, 0, -1, 1, 0, -65536, 1, 0, -65528, 1, 0, 65533, 1, 0, 65534, 1, 0, 65535, 1, 0, 0, 1, 0, 8, 1, 0, 131069, 1, 0, 65544, 1, 0, 196604, 0, 0, 196605, 0, 0, 196606, 0, 0, 196607, 0, 0, 131072, 0, 0, 131073, 0, 0, 131079, 0, 0, 131080, 0, 0, 131081, 0, 0 ) _sections_unfolded = [ "Collision" ] -[node name="Player" parent="." index="1" instance=ExtResource( 2 )] +[node name="NPCs" type="Node2D" parent="." index="1"] + +[node name="NPC" parent="NPCs" index="0" instance=ExtResource( 2 )] + +position = Vector2( 544.265, 95.9369 ) + +[node name="Player" parent="." index="2" instance=ExtResource( 3 )] Speed = 20