This commit is contained in:
2022-11-11 18:36:01 +01:00
parent 65e6bbea0a
commit bd49f35e5a
16 changed files with 349 additions and 0 deletions

6
RPG-Test.csproj Normal file
View File

@@ -0,0 +1,6 @@
<Project Sdk="Godot.NET.Sdk/3.3.0">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RootNamespace>RPGTest</RootNamespace>
</PropertyGroup>
</Project>

19
RPG-Test.sln Normal file
View File

@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RPG-Test", "RPG-Test.csproj", "{03530658-9683-4AB8-AC24-354105EBCCDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{03530658-9683-4AB8-AC24-354105EBCCDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03530658-9683-4AB8-AC24-354105EBCCDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03530658-9683-4AB8-AC24-354105EBCCDD}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{03530658-9683-4AB8-AC24-354105EBCCDD}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{03530658-9683-4AB8-AC24-354105EBCCDD}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{03530658-9683-4AB8-AC24-354105EBCCDD}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
EndGlobal

BIN
assets/textures/cupcake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/cupcake.png-93ee0951f9b3ff6300047d14826a099b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/cupcake.png"
dest_files=[ "res://.import/cupcake.png-93ee0951f9b3ff6300047d14826a099b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/test_background_tileset.png-6a994978cefc6df9f5920903f59e7192.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/textures/test_background_tileset.png"
dest_files=[ "res://.import/test_background_tileset.png-6a994978cefc6df9f5920903f59e7192.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

7
default_env.tres Normal file
View File

@@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

35
icon.png.import Normal file
View File

@@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

74
project.godot Normal file
View File

@@ -0,0 +1,74 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
[application]
config/name="RPG-Test"
run/main_scene="res://scenes/Main.tscn"
config/icon="res://icon.png"
[display]
window/size/height=640
[gui]
common/drop_mouse_on_gui_input_disabled=true
[input]
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":-1.0,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":2,"axis_value":1.0,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
move_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":-1.0,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":3,"axis_value":1.0,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
[mono]
project/assembly_name="RPG-Test"
[physics]
common/enable_pause_aware_picking=true
[rendering]
environment/default_environment="res://default_env.tres"

10
scenes/Main.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/World.tscn" type="PackedScene" id=2]
[node name="Main" type="Node2D"]
[node name="World" parent="." instance=ExtResource( 2 )]
[node name="Player" parent="." instance=ExtResource( 1 )]

32
scenes/Player.tscn Normal file
View File

@@ -0,0 +1,32 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://assets/textures/cupcake.png" type="Texture" id=1]
[ext_resource path="res://src/Player.cs" type="Script" id=2]
[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 1 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=2]
radius = 11.0
height = 4.0
[node name="Player" type="Area2D"]
script = ExtResource( 2 )
__meta__ = {
"_edit_group_": true
}
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.2, 0.2 )
frames = SubResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 2 )
[node name="Camera2D" type="Camera2D" parent="."]
current = true

17
scenes/World.tscn Normal file
View File

@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://tilesets/Background.tres" type="TileSet" id=1]
[ext_resource path="res://tilesets/foreground_test.tres" type="TileSet" id=2]
[node name="Background" type="TileMap"]
tile_set = ExtResource( 1 )
cell_size = Vector2( 512, 512 )
cell_quadrant_size = 128
format = 1
tile_data = PoolIntArray( -196613, 1073741824, 0, -196612, 1073741824, 1, -196611, 1073741824, 1, -196610, 1073741824, 1, -196609, 1073741824, 1, -262144, 1073741824, 1, -262143, 1073741824, 1, -262142, 1073741824, 1, -262141, 1073741824, 1, -262140, 1073741824, 2, -131077, 1073741824, 65536, -131076, 1073741824, 65537, -131075, 1073741824, 65537, -131074, 1073741824, 65537, -131073, 1073741824, 65537, -196608, 1073741824, 65537, -196607, 1073741824, 65537, -196606, 1073741824, 65537, -196605, 1073741824, 65537, -196604, 1073741824, 65538, -65541, 1073741824, 65536, -65540, 1073741824, 65537, -65539, 1073741824, 65537, -65538, 1073741824, 65537, -65537, 1073741824, 65537, -131072, 1073741824, 65537, -131071, 1073741824, 65537, -131070, 1073741824, 65537, -131069, 1073741824, 65537, -131068, 1073741824, 65538, -5, 1073741824, 65536, -4, 1073741824, 65537, -3, 1073741824, 65537, -2, 1073741824, 65537, -1, 1073741824, 65537, -65536, 1073741824, 65537, -65535, 1073741824, 65537, -65534, 1073741824, 65537, -65533, 1073741824, 65537, -65532, 1073741824, 65538, 65531, 1073741824, 65536, 65532, 1073741824, 65537, 65533, 1073741824, 65537, 65534, 1073741824, 65537, 65535, 1073741824, 65537, 0, 1073741824, 65537, 1, 1073741824, 65537, 2, 1073741824, 65537, 3, 1073741824, 65537, 4, 1073741824, 65538, 131067, 1073741824, 65536, 131068, 1073741824, 65537, 131069, 1073741824, 65537, 131070, 1073741824, 65537, 131071, 1073741824, 65537, 65536, 1073741824, 65537, 65537, 1073741824, 65537, 65538, 1073741824, 65537, 65539, 1073741824, 65537, 65540, 1073741824, 65538, 196603, 1073741824, 65536, 196604, 1073741824, 65537, 196605, 1073741824, 65537, 196606, 1073741824, 65537, 196607, 1073741824, 65537, 131072, 1073741824, 65537, 131073, 1073741824, 65537, 131074, 1073741824, 65537, 131075, 1073741824, 65537, 131076, 1073741824, 65538, 262139, 1073741824, 131072, 262140, 1073741824, 131073, 262141, 1073741824, 131073, 262142, 1073741824, 131073, 262143, 1073741824, 131073, 196608, 1073741824, 131073, 196609, 1073741824, 131073, 196610, 1073741824, 131073, 196611, 1073741824, 131073, 196612, 1073741824, 131074 )
[node name="Foreground" type="TileMap" parent="."]
tile_set = ExtResource( 2 )
cell_size = Vector2( 128, 128 )
format = 1
tile_data = PoolIntArray( -131073, 1073741824, 0, -196608, 1073741824, 0, -65537, 1073741824, 0, -131072, 1073741824, 0, -2, 1073741824, 0, -1, 1073741824, 0, -65536, 1073741824, 0, -65535, 1073741824, 0, -65534, 1073741824, 0, 65532, 1073741824, 0, 65533, 1073741824, 0, 65534, 1073741824, 0, 0, 1073741824, 0, 1, 1073741824, 0, 131068, 1073741824, 0, 131069, 1073741824, 0, 131070, 1073741824, 0, 131071, 1073741824, 0, 65536, 1073741824, 0, 65537, 1073741824, 0, 196604, 1073741824, 0, 196606, 1073741824, 0, 196607, 1073741824, 0, 131072, 1073741824, 0, 131073, 1073741824, 0, 131074, 1073741824, 0, 131075, 1073741824, 0, 262140, 1073741824, 0, 262141, 1073741824, 0, 262142, 1073741824, 0, 262143, 1073741824, 0, 196608, 1073741824, 0, 196609, 1073741824, 0, 196610, 1073741824, 0, 196611, 1073741824, 0, 196612, 1073741824, 0, 327677, 1073741824, 0, 327678, 1073741824, 0, 327679, 1073741824, 0, 262144, 1073741824, 0, 262145, 1073741824, 0, 262146, 1073741824, 0, 262147, 1073741824, 0, 327681, 1073741824, 0, 327682, 1073741824, 0 )

32
src/Player.cs Normal file
View File

@@ -0,0 +1,32 @@
using Godot;
using System;
public class Player : Area2D
{
[Export]
public int speed = 400;
public override void _Ready()
{
}
public override void _Process(float delta)
{
if (Input.IsActionPressed("move_left"))
{
Position -= new Vector2(speed, 0) * delta;
}
if (Input.IsActionPressed("move_right"))
{
Position += new Vector2(speed, 0) * delta;
}
if (Input.IsActionPressed("move_up"))
{
Position -= new Vector2(0, speed) * delta;
}
if (Input.IsActionPressed("move_down"))
{
Position += new Vector2(0, speed) * delta;
}
}
}

28
tilesets/Background.tres Normal file
View File

@@ -0,0 +1,28 @@
[gd_resource type="TileSet" load_steps=2 format=2]
[ext_resource path="res://assets/textures/test_background_tileset.png" type="Texture" id=1]
[resource]
0/name = "test_background_tileset.png 0"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 1536, 1536 )
0/tile_mode = 1
0/autotile/bitmask_mode = 0
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 256, Vector2( 0, 1 ), 260, Vector2( 0, 2 ), 4, Vector2( 1, 0 ), 320, Vector2( 1, 1 ), 325, Vector2( 1, 2 ), 5, Vector2( 2, 0 ), 64, Vector2( 2, 1 ), 65, Vector2( 2, 2 ), 1 ]
0/autotile/icon_coordinate = Vector2( 1, 1 )
0/autotile/tile_size = Vector2( 512, 512 )
0/autotile/spacing = 0
0/autotile/occluder_map = [ ]
0/autotile/navpoly_map = [ ]
0/autotile/priority_map = [ Vector3( 0, 0, 9 ), Vector3( 0, 1, 6 ), Vector3( 0, 2, 3 ), Vector3( 1, 0, 8 ), Vector3( 1, 1, 5 ), Vector3( 1, 2, 2 ), Vector3( 2, 0, 7 ), Vector3( 2, 1, 4 ) ]
0/autotile/z_index_map = [ ]
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0

View File

@@ -0,0 +1,19 @@
[gd_resource type="TileSet" load_steps=2 format=2]
[ext_resource path="res://assets/textures/cupcake.png" type="Texture" id=1]
[resource]
0/name = "cupcake.png 0"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( -32, -32, 192, 192 )
0/tile_mode = 0
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0