mirror of
https://codeberg.org/Melon-Bread/Comets.gd.git
synced 2024-11-24 21:18:21 -05:00
Maped out concepts that need to be worked on
This commit is contained in:
parent
c7ce3be782
commit
604b631bfb
@ -1,5 +1,11 @@
|
|||||||
extends Area2D
|
extends Area2D
|
||||||
|
|
||||||
|
# TODO: Have a list of "sizes" a comet can be
|
||||||
|
# TODO: Have speeds be determined on a rage based on its "size"
|
||||||
|
# TODO: Provide a specific score based on the "size"
|
||||||
|
# TODO: Have the comet spawn 2 of the next "size" when hit
|
||||||
|
# TODO: Have the comet disapear if shot at is smallest "size"
|
||||||
|
|
||||||
@export var movement_speed := 600
|
@export var movement_speed := 600
|
||||||
|
|
||||||
var rotation_speed : int
|
var rotation_speed : int
|
||||||
@ -12,11 +18,15 @@ func _ready() -> void:
|
|||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
rotate(deg_to_rad(rotaion_direction * rotation_speed * delta))
|
rotate(deg_to_rad(rotaion_direction * rotation_speed * delta))
|
||||||
|
|
||||||
|
# TODO: Add "floating in space" movement
|
||||||
|
|
||||||
|
# Screen Wrap
|
||||||
|
var viewport_size := get_viewport_rect().size
|
||||||
|
position.x = wrap(position.x, 0, viewport_size.x)
|
||||||
|
position.y = wrap(position.y, 0,viewport_size.y)
|
||||||
|
|
||||||
func _on_body_entered(body: Node2D) -> void:
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
print(body)
|
print(body)
|
||||||
|
# TODO: Add "explosion" logic if bullet hits me
|
||||||
if body.is_in_group("ship"):
|
if body.is_in_group("ship"):
|
||||||
body.crash()
|
body.crash()
|
||||||
|
10
scenes/game.gd
Normal file
10
scenes/game.gd
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
# TODO: Make a HUD that shows "level" and "score" (& maybe high score)
|
||||||
|
# TODO: Display a game over screen when the ship is hit by a comet with abilty to restart
|
||||||
|
# TODO: Create a node that randomly spwans some comets on the map
|
||||||
|
# TODO: Detect when all comets are gone and increase the level (& maybe speed?)
|
||||||
|
# TODO: Make a space like background, maybe some scrolling, maybe randomly generated
|
||||||
|
# TODO: Make a small title screen that starts before the game scene
|
||||||
|
# TODO: MAYBE track high score in a file
|
||||||
|
|
@ -1,9 +1,11 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://bdarunpk3c2eh"]
|
[gd_scene load_steps=4 format=3 uid="uid://bdarunpk3c2eh"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scenes/game.gd" id="1_6727i"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cbo47ftx0vcro" path="res://scenes/ship.tscn" id="1_esyqo"]
|
[ext_resource type="PackedScene" uid="uid://cbo47ftx0vcro" path="res://scenes/ship.tscn" id="1_esyqo"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bsonrs8vhtly8" path="res://scenes/comet.tscn" id="2_b37uv"]
|
[ext_resource type="PackedScene" uid="uid://bsonrs8vhtly8" path="res://scenes/comet.tscn" id="2_b37uv"]
|
||||||
|
|
||||||
[node name="Game" type="Node2D"]
|
[node name="Game" type="Node2D"]
|
||||||
|
script = ExtResource("1_6727i")
|
||||||
|
|
||||||
[node name="Background" type="CanvasLayer" parent="."]
|
[node name="Background" type="CanvasLayer" parent="."]
|
||||||
layer = -1
|
layer = -1
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
extends Area2D
|
extends Area2D
|
||||||
|
|
||||||
|
# TODO: Tweak speed and LifeTimer values
|
||||||
|
|
||||||
@export var speed := 1400.00
|
@export var speed := 1400.00
|
||||||
var direction := Vector2.UP
|
var direction := Vector2.UP
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
# Movement
|
# Movement
|
||||||
position += direction.rotated(rotation) * speed * delta
|
position += direction.rotated(rotation) * speed * delta
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
extends CharacterBody2D
|
extends CharacterBody2D
|
||||||
|
|
||||||
|
# TODO: Add the ability to "warp"
|
||||||
|
# TODO: Tweak speed and shoot time values
|
||||||
|
|
||||||
const BULLET = preload("res://scenes/bullet.tscn")
|
const BULLET = preload("res://scenes/bullet.tscn")
|
||||||
|
|
||||||
@export var accleration := 90.0
|
@export var accleration := 90.0
|
||||||
@ -43,6 +46,7 @@ func fire_gun(pos : Vector2, rot : float) -> void:
|
|||||||
$ShotCooldown.start()
|
$ShotCooldown.start()
|
||||||
|
|
||||||
func crash():
|
func crash():
|
||||||
|
# TODO: Maybe emit a signal that the main game node listens for "game over" state
|
||||||
$AnimationPlayer.play("crash")
|
$AnimationPlayer.play("crash")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user