Skip to content

Commit

Permalink
Merge pull request #5 from campenr/feature/second-enemy
Browse files Browse the repository at this point in the history
Feature/second enemy
  • Loading branch information
campenr authored Aug 25, 2024
2 parents d348e21 + 2003230 commit 33ef278
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 2 deletions.
Binary file added designs/SpawnerLayout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions designs/SpawnerLayout.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://defu5x74ekv6x"
path="res://.godot/imported/SpawnerLayout.png-689379d548d5a956d95c4f2f46d48db7.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://designs/SpawnerLayout.png"
dest_files=["res://.godot/imported/SpawnerLayout.png-689379d548d5a956d95c4f2f46d48db7.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
37 changes: 37 additions & 0 deletions designs/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Design Notes

General design notes for radius-game.


## Overview

Pitch: Gradius x noita wands (other games have similar mechanics but thats the only one I know by name).


## Weapons
- base weapon is simple
- can add effects to the weapon to modify its behavior
- set number of slots i.e. 10? 20?
- effects inlcude:
- multiplier: increases number of firing nodes
- speed: increases speed of projectile
- rate: increases rate of fire
- size: makes projectile larger
- explosive?: projectile explodes after a certain time
- sequential?: projectile spawns more projectiles after a certain time
- status effects?: projectiles apply different damage types


## Spawners

- set spawner node locations
- each node can be used as a target for instancing an enemy spawner that spawns a particular enemy
- for a configured amount of time / configured rate
- define in a cfg file for easier customising of enemies


## Levels

- levels are just a sequence of enemies spawned at given nodes after certain delays
- each level ends with a big boss
- define in a cfg file to allow easier writing / tweaking of levels
3 changes: 3 additions & 0 deletions units/enemies.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Enemy1]

base_speed=150
22 changes: 20 additions & 2 deletions units/enemy.gd
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
extends Node2D


const SPEED = 150
var base_speed = 0


func _ready():
var config = ConfigFile.new()

# Load data from a file.
var err = config.load("res://units/enemies.cfg")

# If the file didn't load, ignore it.
if err != OK:
print('Failed to load file')
get_tree().quit(1)

# Iterate over all sections.
# only one enemy for now so the below is fine.
for enemy in config.get_sections():
# Fetch the data for each section.
base_speed = config.get_value(enemy, "base_speed")


func _physics_process(delta):
position -= transform.x * SPEED * delta
position -= transform.x * base_speed * delta


func _on_visible_on_screen_notifier_2d_screen_exited():
Expand Down

0 comments on commit 33ef278

Please sign in to comment.