mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 05:20:06 +01:00
Updated Dodge the Creeps C# to Godot mono 4.2 (#1000)
Co-authored-by: Ivan Shakhov <van800@gmail.com> Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
This commit is contained in:
@@ -47,7 +47,7 @@ func start(pos):
|
||||
$CollisionShape2D.disabled = false
|
||||
|
||||
|
||||
func _on_Player_body_entered(_body):
|
||||
func _on_body_entered(_body):
|
||||
hide() # Player disappears after being hit.
|
||||
hit.emit()
|
||||
# Must be deferred as we can't change physics properties on a physics callback.
|
||||
|
||||
@@ -72,4 +72,4 @@ process_material = SubResource("7")
|
||||
texture = ExtResource("2")
|
||||
speed_scale = 2.0
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_Player_body_entered"]
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.0.0-dev5">
|
||||
<Project Sdk="Godot.NET.Sdk/4.2.1">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<RootNamespace>DodgeTheCreeps</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="**/*.tscn" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="project.godot" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -3,7 +3,7 @@ using Godot;
|
||||
public partial class HUD : CanvasLayer
|
||||
{
|
||||
[Signal]
|
||||
public delegate void StartGame();
|
||||
public delegate void StartGameEventHandler();
|
||||
|
||||
public void ShowMessage(string text)
|
||||
{
|
||||
@@ -19,11 +19,10 @@ public partial class HUD : CanvasLayer
|
||||
ShowMessage("Game Over");
|
||||
|
||||
var messageTimer = GetNode<Timer>("MessageTimer");
|
||||
await ToSignal(messageTimer, "timeout");
|
||||
await ToSignal(messageTimer, Timer.SignalName.Timeout);
|
||||
|
||||
var messageLabel = GetNode<Label>("MessageLabel");
|
||||
messageLabel.Text = "Dodge the\nCreeps!";
|
||||
messageLabel.Show();
|
||||
ShowMessage("Dodge the\nCreeps!");
|
||||
await ToSignal(GetTree().CreateTimer(1.0), SceneTreeTimer.SignalName.Timeout);
|
||||
|
||||
GetNode<Button>("StartButton").Show();
|
||||
}
|
||||
@@ -36,7 +35,7 @@ public partial class HUD : CanvasLayer
|
||||
public void OnStartButtonPressed()
|
||||
{
|
||||
GetNode<Button>("StartButton").Hide();
|
||||
EmitSignal(nameof(StartGame));
|
||||
EmitSignal(SignalName.StartGame);
|
||||
}
|
||||
|
||||
public void OnMessageTimerTimeout()
|
||||
|
||||
@@ -1,61 +1,62 @@
|
||||
[gd_scene load_steps=6 format=2]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://b0ljm4vbkww0f"]
|
||||
|
||||
[ext_resource path="res://HUD.cs" type="Script" id=1]
|
||||
[ext_resource path="res://fonts/Xolonium-Regular.ttf" type="FontData" id=2]
|
||||
[ext_resource type="Script" path="res://HUD.cs" id="1"]
|
||||
[ext_resource type="FontFile" uid="uid://cu4g4pt1v4fyv" path="res://fonts/Xolonium-Regular.ttf" id="2"]
|
||||
|
||||
[sub_resource type="Font" id=1]
|
||||
size = 64
|
||||
use_mipmaps = true
|
||||
font_data = ExtResource( 2 )
|
||||
[sub_resource type="InputEventAction" id="InputEventAction_vmrao"]
|
||||
action = &"start_game"
|
||||
|
||||
[sub_resource type="Font" id=2]
|
||||
size = 64
|
||||
use_mipmaps = true
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="Font" id=3]
|
||||
size = 64
|
||||
use_mipmaps = true
|
||||
font_data = ExtResource( 2 )
|
||||
[sub_resource type="Shortcut" id="Shortcut_b2h4v"]
|
||||
events = [SubResource("InputEventAction_vmrao")]
|
||||
|
||||
[node name="HUD" type="CanvasLayer"]
|
||||
script = ExtResource( 1 )
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="ScoreLabel" type="Label" parent="."]
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -25.0
|
||||
offset_right = 25.0
|
||||
offset_bottom = 100.0
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "0
|
||||
"
|
||||
align = 1
|
||||
grow_horizontal = 2
|
||||
theme_override_fonts/font = ExtResource("2")
|
||||
theme_override_font_sizes/font_size = 64
|
||||
text = "0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="MessageLabel" type="Label" parent="."]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -200.0
|
||||
offset_top = -150.0
|
||||
offset_right = 200.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
offset_left = -240.0
|
||||
offset_top = -79.5
|
||||
offset_right = 240.0
|
||||
offset_bottom = 79.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_fonts/font = ExtResource("2")
|
||||
theme_override_font_sizes/font_size = 64
|
||||
text = "Dodge the
|
||||
Creeps!"
|
||||
align = 1
|
||||
valign = 1
|
||||
Creeps"
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="StartButton" type="Button" parent="."]
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -100.0
|
||||
offset_top = -200.0
|
||||
offset_top = -140.0
|
||||
offset_right = 100.0
|
||||
offset_bottom = -100.0
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
offset_bottom = -40.0
|
||||
theme_override_fonts/font = ExtResource("2")
|
||||
theme_override_font_sizes/font_size = 65
|
||||
shortcut = SubResource("Shortcut_b2h4v")
|
||||
text = "Start"
|
||||
|
||||
[node name="MessageTimer" type="Timer" parent="."]
|
||||
|
||||
@@ -5,15 +5,10 @@ public partial class Main : Node
|
||||
#pragma warning disable 649
|
||||
// We assign this in the editor, so we don't need the warning about not being assigned.
|
||||
[Export]
|
||||
public PackedScene mobScene;
|
||||
public PackedScene MobScene { get; set; }
|
||||
#pragma warning restore 649
|
||||
|
||||
public int score;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
GD.Randomize();
|
||||
}
|
||||
private int _score;
|
||||
|
||||
public void GameOver()
|
||||
{
|
||||
@@ -30,48 +25,53 @@ public partial class Main : Node
|
||||
{
|
||||
// Note that for calling Godot-provided methods with strings,
|
||||
// we have to use the original Godot snake_case name.
|
||||
GetTree().CallGroup("mobs", "queue_free");
|
||||
score = 0;
|
||||
GetTree().CallGroup("mobs", Node.MethodName.QueueFree);
|
||||
_score = 0;
|
||||
|
||||
var player = GetNode<Player>("Player");
|
||||
var startPosition = GetNode<Position2D>("StartPosition");
|
||||
var startPosition = GetNode<Marker2D>("StartPosition");
|
||||
player.Start(startPosition.Position);
|
||||
|
||||
GetNode<Timer>("StartTimer").Start();
|
||||
|
||||
var hud = GetNode<HUD>("HUD");
|
||||
hud.UpdateScore(score);
|
||||
hud.UpdateScore(_score);
|
||||
hud.ShowMessage("Get Ready!");
|
||||
|
||||
GetNode<AudioStreamPlayer>("Music").Play();
|
||||
}
|
||||
|
||||
public void OnStartTimerTimeout()
|
||||
private void OnStartTimerTimeout()
|
||||
{
|
||||
GetNode<Timer>("MobTimer").Start();
|
||||
GetNode<Timer>("ScoreTimer").Start();
|
||||
}
|
||||
|
||||
public void OnScoreTimerTimeout()
|
||||
private void OnScoreTimerTimeout()
|
||||
{
|
||||
score++;
|
||||
_score++;
|
||||
|
||||
GetNode<HUD>("HUD").UpdateScore(score);
|
||||
GetNode<HUD>("HUD").UpdateScore(_score);
|
||||
}
|
||||
|
||||
public void OnMobTimerTimeout()
|
||||
// We also specified this function name in PascalCase in the editor's connection window.
|
||||
private void OnMobTimerTimeout()
|
||||
{
|
||||
// Note: Normally it is best to use explicit types rather than the `var`
|
||||
// keyword. However, var is acceptable to use here because the types are
|
||||
// obviously PathFollow2D and Mob, since they appear later on the line.
|
||||
// obviously Mob and PathFollow2D, since they appear later on the line.
|
||||
|
||||
if (MobScene is null)
|
||||
{
|
||||
GD.PrintErr("Mob scene is not set. You need to set it in the inspector.");
|
||||
return;
|
||||
}
|
||||
// Create a new instance of the Mob scene.
|
||||
Mob mob = MobScene.Instantiate<Mob>();
|
||||
|
||||
// Choose a random location on Path2D.
|
||||
var mobSpawnLocation = GetNode<PathFollow2D>("MobPath/MobSpawnLocation");
|
||||
mobSpawnLocation.Offset = GD.Randi();
|
||||
|
||||
// Create a Mob instance and add it to the scene.
|
||||
var mob = (Mob)mobScene.Instantiate();
|
||||
AddChild(mob);
|
||||
mobSpawnLocation.ProgressRatio = GD.Randf();
|
||||
|
||||
// Set the mob's direction perpendicular to the path direction.
|
||||
float direction = mobSpawnLocation.Rotation + Mathf.Pi / 2;
|
||||
@@ -86,5 +86,8 @@ public partial class Main : Node
|
||||
// Choose the velocity for the mob.
|
||||
var velocity = new Vector2((float)GD.RandRange(150.0, 250.0), 0);
|
||||
mob.LinearVelocity = velocity.Rotated(direction);
|
||||
|
||||
// Spawn the mob by adding it to the Main scene.
|
||||
AddChild(mob);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://oq3nlri51jl3"]
|
||||
|
||||
[ext_resource path="res://Main.cs" type="Script" id=1]
|
||||
[ext_resource path="res://Mob.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://HUD.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://art/House In a Forest Loop.ogg" type="AudioStream" id=5]
|
||||
[ext_resource path="res://art/gameover.wav" type="AudioStream" id=6]
|
||||
[ext_resource type="Script" path="res://Main.cs" id="1_t4q5g"]
|
||||
[ext_resource type="PackedScene" uid="uid://ixe1g4hv46xs" path="res://Mob.tscn" id="2_06wge"]
|
||||
[ext_resource type="PackedScene" uid="uid://u1nbrhmt1vqu" path="res://Player.tscn" id="3_ouh2a"]
|
||||
[ext_resource type="PackedScene" uid="uid://b0ljm4vbkww0f" path="res://HUD.tscn" id="4_f8bkj"]
|
||||
[ext_resource type="AudioStream" uid="uid://cwm86fnmnh0sh" path="res://art/House In a Forest Loop.ogg" id="5_dnvwy"]
|
||||
[ext_resource type="AudioStream" uid="uid://i4rhnwpnljso" path="res://art/gameover.wav" id="5_r2snl"]
|
||||
|
||||
[sub_resource type="Curve2D" id=1]
|
||||
[sub_resource type="Curve2D" id="1"]
|
||||
_data = {
|
||||
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0)
|
||||
}
|
||||
point_count = 5
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
mobScene = ExtResource( 2 )
|
||||
script = ExtResource("1_t4q5g")
|
||||
MobScene = ExtResource("2_06wge")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color(0.219608, 0.372549, 0.380392, 1)
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 3 )]
|
||||
[node name="Player" parent="." instance=ExtResource("3_ouh2a")]
|
||||
|
||||
[node name="MobTimer" type="Timer" parent="."]
|
||||
wait_time = 0.5
|
||||
@@ -32,21 +34,21 @@ wait_time = 0.5
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
|
||||
[node name="StartPosition" type="Position2D" parent="."]
|
||||
[node name="StartPosition" type="Marker2D" parent="."]
|
||||
position = Vector2(240, 450)
|
||||
|
||||
[node name="MobPath" type="Path2D" parent="."]
|
||||
curve = SubResource( 1 )
|
||||
curve = SubResource("1")
|
||||
|
||||
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource( 4 )]
|
||||
[node name="HUD" parent="." instance=ExtResource("4_f8bkj")]
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 5 )
|
||||
stream = ExtResource("5_dnvwy")
|
||||
|
||||
[node name="DeathSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 6 )
|
||||
stream = ExtResource("5_r2snl")
|
||||
|
||||
[connection signal="Hit" from="Player" to="." method="GameOver"]
|
||||
[connection signal="timeout" from="MobTimer" to="." method="OnMobTimerTimeout"]
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Mob : RigidDynamicBody2D
|
||||
public partial class Mob : RigidBody2D
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
var animSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
||||
animSprite.Playing = true;
|
||||
string[] mobTypes = animSprite.Frames.GetAnimationNames();
|
||||
animSprite.Animation = mobTypes[GD.Randi() % mobTypes.Length];
|
||||
var animatedSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
||||
string[] mobTypes = animatedSprite.SpriteFrames.GetAnimationNames();
|
||||
animatedSprite.Play(mobTypes[GD.Randi() % mobTypes.Length]);
|
||||
}
|
||||
|
||||
public void OnVisibilityScreenExited()
|
||||
public void OnVisibleOnScreenNotifier2DScreenExited()
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
@@ -1,54 +1,67 @@
|
||||
[gd_scene load_steps=10 format=2]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://ixe1g4hv46xs"]
|
||||
|
||||
[ext_resource path="res://Mob.cs" type="Script" id=1]
|
||||
[ext_resource path="res://art/enemySwimming_1.png" type="Texture2D" id=2]
|
||||
[ext_resource path="res://art/enemySwimming_2.png" type="Texture2D" id=3]
|
||||
[ext_resource path="res://art/enemyWalking_1.png" type="Texture2D" id=4]
|
||||
[ext_resource path="res://art/enemyWalking_2.png" type="Texture2D" id=5]
|
||||
[ext_resource path="res://art/enemyFlyingAlt_1.png" type="Texture2D" id=6]
|
||||
[ext_resource path="res://art/enemyFlyingAlt_2.png" type="Texture2D" id=7]
|
||||
[ext_resource type="Script" path="res://Mob.cs" id="1"]
|
||||
[ext_resource type="Texture2D" uid="uid://cs7c2mx7kjda5" path="res://art/enemySwimming_1.png" id="2"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwhy2f3yw4bc8" path="res://art/enemySwimming_2.png" id="3"]
|
||||
[ext_resource type="Texture2D" uid="uid://brrcidfqf6bgp" path="res://art/enemyWalking_1.png" id="4"]
|
||||
[ext_resource type="Texture2D" uid="uid://bctq8ot1ilm0m" path="res://art/enemyWalking_2.png" id="5"]
|
||||
[ext_resource type="Texture2D" uid="uid://6agt7sebvtk0" path="res://art/enemyFlyingAlt_1.png" id="6"]
|
||||
[ext_resource type="Texture2D" uid="uid://co0kr2y7s2u0e" path="res://art/enemyFlyingAlt_2.png" id="7"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
[sub_resource type="SpriteFrames" id="1"]
|
||||
animations = [{
|
||||
"frames": [ExtResource( 4 ), ExtResource( 5 )],
|
||||
"loop": true,
|
||||
"name": "walk",
|
||||
"speed": 4.0
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("6")
|
||||
}, {
|
||||
"frames": [ExtResource( 6 ), ExtResource( 7 )],
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("7")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": "fly",
|
||||
"name": &"fly",
|
||||
"speed": 3.0
|
||||
}, {
|
||||
"frames": [ExtResource( 2 ), ExtResource( 3 )],
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": "swim",
|
||||
"name": &"swim",
|
||||
"speed": 4.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 4.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=2]
|
||||
radius = 35.8898
|
||||
height = 29.3103
|
||||
[sub_resource type="CapsuleShape2D" id="2"]
|
||||
radius = 37.0
|
||||
height = 100.0
|
||||
|
||||
[node name="Mob" type="RigidDynamicBody2D" groups=["mobs"]]
|
||||
[node name="Mob" type="RigidBody2D" groups=["mobs"]]
|
||||
collision_mask = 0
|
||||
gravity_scale = 0.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.75, 0.75)
|
||||
frames = SubResource( 1 )
|
||||
animation = "walk"
|
||||
sprite_frames = SubResource("1")
|
||||
animation = &"walk"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
rotation = 1.5708
|
||||
shape = SubResource( 2 )
|
||||
shape = SubResource("2")
|
||||
|
||||
[node name="Visibility" type="VisibleOnScreenNotifier2D" parent="."]
|
||||
position = Vector2(-0.315128, -9.53674e-07)
|
||||
scale = Vector2(5.00208, 3.58402)
|
||||
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
||||
|
||||
[connection signal="screen_exited" from="Visibility" to="." method="OnVisibilityScreenExited"]
|
||||
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="OnVisibleOnScreenNotifier2DScreenExited"]
|
||||
|
||||
@@ -3,48 +3,48 @@ using Godot;
|
||||
public partial class Player : Area2D
|
||||
{
|
||||
[Signal]
|
||||
public delegate void Hit();
|
||||
public delegate void HitEventHandler();
|
||||
|
||||
[Export]
|
||||
public int speed = 400; // How fast the player will move (pixels/sec).
|
||||
public int Speed { get; set; } = 400; // How fast the player will move (pixels/sec).
|
||||
|
||||
public Vector2 screenSize; // Size of the game window.
|
||||
public Vector2 ScreenSize { get; set; } // Size of the game window.
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
screenSize = GetViewportRect().Size;
|
||||
ScreenSize = GetViewportRect().Size;
|
||||
Hide();
|
||||
}
|
||||
|
||||
public override void _Process(float delta)
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
var velocity = Vector2.Zero; // The player's movement vector.
|
||||
var velocity = Vector2.Zero;
|
||||
|
||||
if (Input.IsActionPressed("move_right"))
|
||||
{
|
||||
velocity.x += 1;
|
||||
velocity.X += 1;
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("move_left"))
|
||||
{
|
||||
velocity.x -= 1;
|
||||
velocity.X -= 1;
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("move_down"))
|
||||
{
|
||||
velocity.y += 1;
|
||||
velocity.Y += 1;
|
||||
}
|
||||
|
||||
if (Input.IsActionPressed("move_up"))
|
||||
{
|
||||
velocity.y -= 1;
|
||||
velocity.Y -= 1;
|
||||
}
|
||||
|
||||
var animatedSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
||||
|
||||
if (velocity.Length() > 0)
|
||||
{
|
||||
velocity = velocity.Normalized() * speed;
|
||||
velocity = velocity.Normalized() * Speed;
|
||||
animatedSprite.Play();
|
||||
}
|
||||
else
|
||||
@@ -52,38 +52,37 @@ public partial class Player : Area2D
|
||||
animatedSprite.Stop();
|
||||
}
|
||||
|
||||
Position += velocity * delta;
|
||||
Position += velocity * (float)delta;
|
||||
Position = new Vector2(
|
||||
x: Mathf.Clamp(Position.x, 0, screenSize.x),
|
||||
y: Mathf.Clamp(Position.y, 0, screenSize.y)
|
||||
x: Mathf.Clamp(Position.X, 0, ScreenSize.X),
|
||||
y: Mathf.Clamp(Position.Y, 0, ScreenSize.Y)
|
||||
);
|
||||
|
||||
if (velocity.x != 0)
|
||||
if (velocity.X != 0)
|
||||
{
|
||||
animatedSprite.Animation = "right";
|
||||
// See the note below about boolean assignment.
|
||||
animatedSprite.FlipH = velocity.x < 0;
|
||||
animatedSprite.FlipV = false;
|
||||
animatedSprite.FlipH = velocity.X < 0;
|
||||
}
|
||||
else if (velocity.y != 0)
|
||||
else if (velocity.Y != 0)
|
||||
{
|
||||
animatedSprite.Animation = "up";
|
||||
animatedSprite.FlipV = velocity.y > 0;
|
||||
animatedSprite.FlipV = velocity.Y > 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void Start(Vector2 pos)
|
||||
public void Start(Vector2 position)
|
||||
{
|
||||
Position = pos;
|
||||
Position = position;
|
||||
Show();
|
||||
GetNode<CollisionShape2D>("CollisionShape2D").Disabled = false;
|
||||
}
|
||||
|
||||
public void OnPlayerBodyEntered(PhysicsBody2D body)
|
||||
public void OnBodyEntered(PhysicsBody2D body)
|
||||
{
|
||||
Hide(); // Player disappears after being hit.
|
||||
EmitSignal(nameof(Hit));
|
||||
EmitSignal(SignalName.Hit);
|
||||
// Must be deferred as we can't change physics properties on a physics callback.
|
||||
GetNode<CollisionShape2D>("CollisionShape2D").SetDeferred("disabled", true);
|
||||
GetNode<CollisionShape2D>("CollisionShape2D").SetDeferred(CollisionShape2D.PropertyName.Disabled, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,72 +1,76 @@
|
||||
[gd_scene load_steps=13 format=2]
|
||||
[gd_scene load_steps=11 format=4 uid="uid://u1nbrhmt1vqu"]
|
||||
|
||||
[ext_resource path="res://Player.cs" type="Script" id=1]
|
||||
[ext_resource path="res://art/playerGrey_walk1.png" type="Texture2D" id=2]
|
||||
[ext_resource path="res://art/playerGrey_walk2.png" type="Texture2D" id=3]
|
||||
[ext_resource path="res://art/playerGrey_up1.png" type="Texture2D" id=4]
|
||||
[ext_resource path="res://art/playerGrey_up2.png" type="Texture2D" id=5]
|
||||
[ext_resource type="Script" path="res://Player.cs" id="1"]
|
||||
[ext_resource type="Texture2D" uid="uid://bevol1mted15l" path="res://art/playerGrey_walk1.png" id="2"]
|
||||
[ext_resource type="Texture2D" uid="uid://0sl7rvmm0hy8" path="res://art/playerGrey_walk2.png" id="3"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddykfjshfswbs" path="res://art/playerGrey_up1.png" id="4"]
|
||||
[ext_resource type="Texture2D" uid="uid://03fwq5c2p4k3" path="res://art/playerGrey_up2.png" id="5"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
[sub_resource type="SpriteFrames" id="1"]
|
||||
animations = [{
|
||||
"frames": [ExtResource( 2 ), ExtResource( 3 )],
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": "right",
|
||||
"name": &"right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [ExtResource( 4 ), ExtResource( 5 )],
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": "up",
|
||||
"name": &"up",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=2]
|
||||
radius = 27.3777
|
||||
height = 14.0303
|
||||
[sub_resource type="CapsuleShape2D" id="2"]
|
||||
radius = 27.0
|
||||
height = 68.0
|
||||
|
||||
[sub_resource type="Gradient" id=3]
|
||||
[sub_resource type="Gradient" id="3"]
|
||||
colors = PackedColorArray(1, 1, 1, 0.501961, 1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="GradientTexture" id=4]
|
||||
gradient = SubResource( 3 )
|
||||
[sub_resource type="GradientTexture1D" id="4"]
|
||||
gradient = SubResource("3")
|
||||
|
||||
[sub_resource type="Curve" id=5]
|
||||
_data = [Vector2(0.00451484, 0.5176), 0.0, 0.0, 0, 0, Vector2(0.98702, 0.3152), 0.0, 0.0, 0, 0]
|
||||
[sub_resource type="Curve" id="5"]
|
||||
_data = [Vector2(0, 0.5), 0.0, 0.0, 0, 0, Vector2(1, 0.333333), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id=6]
|
||||
curve = SubResource( 5 )
|
||||
[sub_resource type="CurveTexture" id="6"]
|
||||
curve = SubResource("5")
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=7]
|
||||
flag_disable_z = true
|
||||
[sub_resource type="ParticleProcessMaterial" id="7"]
|
||||
gravity = Vector3(0, 0, 0)
|
||||
initial_velocity = 1.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
scale = 0.75
|
||||
scale_curve = SubResource( 6 )
|
||||
color_ramp = SubResource( 4 )
|
||||
scale_curve = SubResource("6")
|
||||
color_ramp = SubResource("4")
|
||||
|
||||
[node name="Player" type="Area2D"]
|
||||
z_index = 10
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true
|
||||
}
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.5, 0.5)
|
||||
frames = SubResource( 1 )
|
||||
animation = "right"
|
||||
sprite_frames = SubResource("1")
|
||||
animation = &"right"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 2 )
|
||||
shape = SubResource("2")
|
||||
|
||||
[node name="Trail" type="GPUParticles2D" parent="."]
|
||||
show_behind_parent = true
|
||||
z_index = -1
|
||||
amount = 10
|
||||
process_material = SubResource("7")
|
||||
texture = ExtResource("2")
|
||||
speed_scale = 2.0
|
||||
local_coords = false
|
||||
process_material = SubResource( 7 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="OnPlayerBodyEntered"]
|
||||
[connection signal="body_entered" from="." to="." method="OnBodyEntered"]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://bva7col2lm0cd"
|
||||
uid="uid://cwm86fnmnh0sh"
|
||||
path="res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://6agt7sebvtk0"
|
||||
path="res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyFlyingAlt_1.png"
|
||||
dest_files=["res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex"]
|
||||
dest_files=["res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://co0kr2y7s2u0e"
|
||||
path="res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyFlyingAlt_2.png"
|
||||
dest_files=["res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex"]
|
||||
dest_files=["res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cs7c2mx7kjda5"
|
||||
path="res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemySwimming_1.png"
|
||||
dest_files=["res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex"]
|
||||
dest_files=["res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dwhy2f3yw4bc8"
|
||||
path="res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemySwimming_2.png"
|
||||
dest_files=["res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex"]
|
||||
dest_files=["res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://brrcidfqf6bgp"
|
||||
path="res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyWalking_1.png"
|
||||
dest_files=["res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex"]
|
||||
dest_files=["res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bctq8ot1ilm0m"
|
||||
path="res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/enemyWalking_2.png"
|
||||
dest_files=["res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex"]
|
||||
dest_files=["res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://i4rhnwpnljso"
|
||||
path="res://.godot/imported/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
|
||||
|
||||
[deps]
|
||||
@@ -17,5 +18,7 @@ force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ddykfjshfswbs"
|
||||
path="res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_up1.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex"]
|
||||
dest_files=["res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://03fwq5c2p4k3"
|
||||
path="res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_up2.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex"]
|
||||
dest_files=["res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bevol1mted15l"
|
||||
path="res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_walk1.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex"]
|
||||
dest_files=["res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture2D"
|
||||
path="res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://0sl7rvmm0hy8"
|
||||
path="res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://art/playerGrey_walk2.png"
|
||||
dest_files=["res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex"]
|
||||
dest_files=["res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
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
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
||||
34
mono/dodge_the_creeps/fonts/Xolonium-Regular.ttf.import
Normal file
34
mono/dodge_the_creeps/fonts/Xolonium-Regular.ttf.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://cu4g4pt1v4fyv"
|
||||
path="res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/Xolonium-Regular.ttf"
|
||||
dest_files=["res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
disable_embedded_bitmaps=true
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
@@ -19,48 +19,61 @@ tutorial in the documentation, but ported to C#. For more details,
|
||||
consider following the tutorial in the documentation."
|
||||
config/tags=PackedStringArray("2d", "demo", "official")
|
||||
run/main_scene="res://Main.tscn"
|
||||
config/features=PackedStringArray("4.2")
|
||||
config/features=PackedStringArray("4.2", "C#")
|
||||
config/icon="res://icon.webp"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=480
|
||||
window/size/viewport_height=720
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="Dodge the Creeps with C#"
|
||||
|
||||
[input]
|
||||
|
||||
move_left={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777231,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_right={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777233,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_up={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777232,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":87,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
move_down={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":16777234,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
start_game={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user