Browse Source

basic setup

master
Josh 9 months ago
parent
commit
c5eaf33e66
  1. 1
      .gitignore
  2. 2
      cards/.gitattributes
  3. 2
      cards/.gitignore
  4. 16
      cards/Card.cs
  5. 8
      cards/Ship.cs
  6. 24
      cards/ShipStats.cs
  7. 32
      cards/card.tscn
  8. 8
      cards/cards.csproj
  9. 19
      cards/cards.sln
  10. 1
      cards/icon.svg
  11. 37
      cards/icon.svg.import
  12. 15
      cards/main.tscn
  13. 6
      cards/new_script.cs
  14. 25
      cards/project.godot
  15. BIN
      cards/starfield.jpeg
  16. 34
      cards/starfield.jpeg.import

1
.gitignore

@ -11,3 +11,4 @@ export_presets.cfg
.mono/
data_*/
cards/.vs

2
cards/.gitattributes

@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

2
cards/.gitignore

@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/

16
cards/Card.cs

@ -0,0 +1,16 @@
using Godot;
using System;
public partial class Card : Node2D
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
this.Position += new Vector2(12.0f * (float)delta,0f);
}
}

8
cards/Ship.cs

@ -0,0 +1,8 @@
using Godot;
using System;
using System.Runtime.CompilerServices;
public partial class Ship : Node
{
}

24
cards/ShipStats.cs

@ -0,0 +1,24 @@
using Godot;
using System;
public class ShipStats
{
public string Name;
public int Cost;
public float Speed;
public float ROF;
public float Range;
public float BulletSpeed;
public float MaxHealth;
int _health;
public float Health
{
get => _health;
set
{
_health = (int)Mathf.Clamp(value, 0, MaxHealth);
}
}
}

32
cards/card.tscn

@ -0,0 +1,32 @@
[gd_scene load_steps=2 format=3 uid="uid://0j42r27nq3qa"]
[ext_resource type="Script" path="res://Card.cs" id="1_etv3e"]
[node name="Card" type="Node2D"]
script = ExtResource("1_etv3e")
[node name="ColorRect" type="ColorRect" parent="."]
offset_right = 250.0
offset_bottom = 250.0
[node name="name" type="Label" parent="ColorRect"]
offset_left = -0.0592442
offset_top = 17.0686
offset_right = 249.941
offset_bottom = 195.069
rotation = 0.000558799
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 33
text = "Scout"
horizontal_alignment = 1
[node name="cost" type="Label" parent="ColorRect"]
offset_left = -7.07186
offset_top = -5.92755
offset_right = 242.928
offset_bottom = 172.072
rotation = 0.000558799
theme_override_colors/font_color = Color(0, 0.533333, 0, 1)
theme_override_font_sizes/font_size = 33
text = "2"
horizontal_alignment = 2

8
cards/cards.csproj

@ -0,0 +1,8 @@
<Project Sdk="Godot.NET.Sdk/4.2.1">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project>

19
cards/cards.sln

@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cards", "cards.csproj", "{CAFED15B-89C9-4635-A5B3-6173DDA6A654}"
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
{CAFED15B-89C9-4635-A5B3-6173DDA6A654}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAFED15B-89C9-4635-A5B3-6173DDA6A654}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAFED15B-89C9-4635-A5B3-6173DDA6A654}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{CAFED15B-89C9-4635-A5B3-6173DDA6A654}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{CAFED15B-89C9-4635-A5B3-6173DDA6A654}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{CAFED15B-89C9-4635-A5B3-6173DDA6A654}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
EndGlobal

1
cards/icon.svg

@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

After

Width:  |  Height:  |  Size: 950 B

37
cards/icon.svg.import

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bwjvy0ue7u4sj"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
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/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

15
cards/main.tscn

@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=3 uid="uid://dd1rbd75rjwcl"]
[ext_resource type="PackedScene" uid="uid://0j42r27nq3qa" path="res://card.tscn" id="1_n48to"]
[ext_resource type="Texture2D" uid="uid://dud6h2mq6b52m" path="res://starfield.jpeg" id="2_s71fx"]
[node name="Node2D" type="Node2D"]
[node name="Starfield" type="Sprite2D" parent="."]
position = Vector2(960, 540)
texture = ExtResource("2_s71fx")
[node name="LeftPlayerHand" type="Node2D" parent="."]
[node name="Card" parent="." instance=ExtResource("1_n48to")]
position = Vector2(23, 189)

6
cards/new_script.cs

@ -0,0 +1,6 @@
using Godot;
using System;
public partial class new_script : Node2D
{
}

25
cards/project.godot

@ -0,0 +1,25 @@
; 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=5
[application]
config/name="cards"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.2", "C#", "Forward Plus")
config/icon="res://icon.svg"
[display]
window/size/viewport_width=1920
window/size/viewport_height=1080
[dotnet]
project/assembly_name="cards"

BIN
cards/starfield.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

34
cards/starfield.jpeg.import

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dud6h2mq6b52m"
path="res://.godot/imported/starfield.jpeg-ae8ce81b389d8cac53ad5959cad5e59a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://starfield.jpeg"
dest_files=["res://.godot/imported/starfield.jpeg-ae8ce81b389d8cac53ad5959cad5e59a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
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/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading…
Cancel
Save