Compare commits
No commits in common. "60ee6550018530c06e51d448d71fb8e7f2827c1e" and "2365ba765ca87604be7c40da2416c916ef6bde98" have entirely different histories.
60ee655001
...
2365ba765c
17
Main.tscn
17
Main.tscn
|
|
@ -1,12 +1,11 @@
|
||||||
[gd_scene load_steps=11 format=2]
|
[gd_scene load_steps=10 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/actors/players/playerE/PlayerE.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/actors/players/playerE/PlayerE.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://src/levels/TestBox.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://src/levels/TestBox.tscn" type="PackedScene" id=2]
|
||||||
[ext_resource path="res://src/ui/HUD.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://src/ui/HUD.tscn" type="PackedScene" id=3]
|
||||||
[ext_resource path="res://src/ui/scene_transition.tscn" type="PackedScene" id=4]
|
[ext_resource path="res://src/ui/scene_transition.tscn" type="PackedScene" id=4]
|
||||||
[ext_resource path="res://src/classes/camera_guide.gd" type="Script" id=5]
|
[ext_resource path="res://src/camera_control.gd" type="Script" id=5]
|
||||||
[ext_resource path="res://src/Camera2D.gd" type="Script" id=6]
|
[ext_resource path="res://src/game_camera.gd" type="Script" id=6]
|
||||||
[ext_resource path="res://src/Main.gd" type="Script" id=7]
|
|
||||||
|
|
||||||
[sub_resource type="Shader" id=2]
|
[sub_resource type="Shader" id=2]
|
||||||
code = "shader_type canvas_item;
|
code = "shader_type canvas_item;
|
||||||
|
|
@ -25,7 +24,6 @@ shader_param/cam_offset = Vector2( 0, 0 )
|
||||||
extents = Vector2( 160, 90 )
|
extents = Vector2( 160, 90 )
|
||||||
|
|
||||||
[node name="Main" type="Node2D"]
|
[node name="Main" type="Node2D"]
|
||||||
script = ExtResource( 7 )
|
|
||||||
|
|
||||||
[node name="MusicPlayer" type="AudioStreamPlayer" parent="."]
|
[node name="MusicPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
|
|
||||||
|
|
@ -52,19 +50,18 @@ position = Vector2( 112, 56 )
|
||||||
|
|
||||||
[node name="UI_Layer" parent="ViewportContainer/Viewport" instance=ExtResource( 3 )]
|
[node name="UI_Layer" parent="ViewportContainer/Viewport" instance=ExtResource( 3 )]
|
||||||
|
|
||||||
[node name="CameraGuide" type="KinematicBody2D" parent="ViewportContainer/Viewport"]
|
[node name="KinematicBody2D" type="KinematicBody2D" parent="ViewportContainer/Viewport"]
|
||||||
position = Vector2( 160, 90 )
|
position = Vector2( 160, 90 )
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
collision_mask = 256
|
collision_mask = 256
|
||||||
|
collision/safe_margin = 0.25
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/CameraGuide"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/KinematicBody2D"]
|
||||||
visible = false
|
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
one_way_collision = true
|
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="ViewportContainer/Viewport"]
|
[node name="Camera2D" type="Camera2D" parent="ViewportContainer/Viewport"]
|
||||||
position = Vector2( 160, 90 )
|
position = Vector2( 160, 90 )
|
||||||
current = true
|
current = true
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
tracking_node_path = NodePath("../CameraGuide")
|
tracking_node_path = NodePath("../KinematicBody2D")
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ onready var current_music_track :AudioStream
|
||||||
|
|
||||||
onready var viewport_container = get_node("/root/Main/ViewportContainer") #$ViewportContainer
|
onready var viewport_container = get_node("/root/Main/ViewportContainer") #$ViewportContainer
|
||||||
onready var viewport = get_node("/root/Main/ViewportContainer/Viewport") # $ViewportContainer/Viewport
|
onready var viewport = get_node("/root/Main/ViewportContainer/Viewport") # $ViewportContainer/Viewport
|
||||||
onready var camera_guide :CameraGuide = get_node("/root/Main/ViewportContainer/Viewport/CameraGuide")
|
|
||||||
|
|
||||||
func change_music_track(_music_track :AudioStream ):
|
func change_music_track(_music_track :AudioStream ):
|
||||||
if current_music_track != _music_track:
|
if current_music_track != _music_track:
|
||||||
|
|
@ -37,11 +36,9 @@ func change_level(_level_name :String, _position_name :String):
|
||||||
#var simultaneous_scene = preload("res://levels/level2.tscn").instance()
|
#var simultaneous_scene = preload("res://levels/level2.tscn").instance()
|
||||||
var new_level = load("res://src/levels/" + _level_name + ".tscn" ).instance()
|
var new_level = load("res://src/levels/" + _level_name + ".tscn" ).instance()
|
||||||
#print (get_tree().get_root().get_children())
|
#print (get_tree().get_root().get_children())
|
||||||
|
|
||||||
for l in get_node("/root/Main/ViewportContainer/Viewport").get_children():
|
for l in get_node("/root/Main/ViewportContainer/Viewport").get_children():
|
||||||
#print (get_node("/root/Main").get_children())
|
#print (get_node("/root/Main").get_children())
|
||||||
if l is Level:
|
if l is Level:
|
||||||
camera_guide.disable_tracking()
|
|
||||||
SceneTransition.transition_dissolve("foo")
|
SceneTransition.transition_dissolve("foo")
|
||||||
yield(SceneTransition,"done")
|
yield(SceneTransition,"done")
|
||||||
print(l)
|
print(l)
|
||||||
|
|
@ -52,10 +49,7 @@ func change_level(_level_name :String, _position_name :String):
|
||||||
if new_level.entrances.has(_position_name):
|
if new_level.entrances.has(_position_name):
|
||||||
player_start_position = new_level.entrances[_position_name].transform.origin
|
player_start_position = new_level.entrances[_position_name].transform.origin
|
||||||
print (get_node("/root/Main/ViewportContainer/Viewport").get_children())
|
print (get_node("/root/Main/ViewportContainer/Viewport").get_children())
|
||||||
#get_node("/root/Main/ViewportContainer/Viewport/CameraGuide").global_position = Vector2(160,90)
|
|
||||||
SceneTransition.reset()
|
SceneTransition.reset()
|
||||||
camera_guide.transform.origin = Vector2(160,90)
|
|
||||||
camera_guide.enable_tracking()
|
|
||||||
#get_node("/root/Main").add_child_below_node(SceneTransition,new_level)
|
#get_node("/root/Main").add_child_below_node(SceneTransition,new_level)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,6 @@ _global_script_classes=[ {
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
"path": "res://lib/classes/audiostreamplayer_state_receiver.gd"
|
"path": "res://lib/classes/audiostreamplayer_state_receiver.gd"
|
||||||
}, {
|
}, {
|
||||||
"base": "KinematicBody2D",
|
|
||||||
"class": "CameraGuide",
|
|
||||||
"language": "GDScript",
|
|
||||||
"path": "res://src/classes/camera_guide.gd"
|
|
||||||
}, {
|
|
||||||
"base": "",
|
"base": "",
|
||||||
"class": "GitAPI",
|
"class": "GitAPI",
|
||||||
"language": "NativeScript",
|
"language": "NativeScript",
|
||||||
|
|
@ -123,7 +118,6 @@ _global_script_class_icons={
|
||||||
"Actor": "",
|
"Actor": "",
|
||||||
"AnimatedSprite_StateReceiver": "",
|
"AnimatedSprite_StateReceiver": "",
|
||||||
"AudioStreamPlayer_StateReceiver": "",
|
"AudioStreamPlayer_StateReceiver": "",
|
||||||
"CameraGuide": "",
|
|
||||||
"GitAPI": "",
|
"GitAPI": "",
|
||||||
"HealthComponent": "",
|
"HealthComponent": "",
|
||||||
"HealthPickup": "",
|
"HealthPickup": "",
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,21 @@
|
||||||
[gd_resource type="SpriteFrames" load_steps=5 format=2]
|
[gd_resource type="SpriteFrames" load_steps=6 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/quick_health.png" type="Texture" id=1]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=1]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
|
atlas = ExtResource( 1 )
|
||||||
region = Rect2( 0, 0, 15, 13 )
|
region = Rect2( 0, 0, 15, 13 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=2]
|
[sub_resource type="AtlasTexture" id=2]
|
||||||
|
atlas = ExtResource( 1 )
|
||||||
region = Rect2( 15, 0, 15, 13 )
|
region = Rect2( 15, 0, 15, 13 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=3]
|
[sub_resource type="AtlasTexture" id=3]
|
||||||
|
atlas = ExtResource( 1 )
|
||||||
region = Rect2( 30, 0, 15, 13 )
|
region = Rect2( 30, 0, 15, 13 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=4]
|
[sub_resource type="AtlasTexture" id=4]
|
||||||
|
atlas = ExtResource( 1 )
|
||||||
region = Rect2( 45, 0, 15, 13 )
|
region = Rect2( 45, 0, 15, 13 )
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
|
|
|
||||||
17
src/Main.gd
17
src/Main.gd
|
|
@ -1,17 +0,0 @@
|
||||||
extends Node2D
|
|
||||||
|
|
||||||
|
|
||||||
# Declare member variables here. Examples:
|
|
||||||
# var a = 2
|
|
||||||
# var b = "text"
|
|
||||||
export var starting_level: PackedScene
|
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
|
||||||
func _ready():
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
#func _process(delta):
|
|
||||||
# pass
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
class_name CameraGuide
|
|
||||||
extends KinematicBody2D
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -8,19 +7,11 @@ extends KinematicBody2D
|
||||||
var game_size := Vector2(320,180)
|
var game_size := Vector2(320,180)
|
||||||
onready var window_scale :float = (OS.window_size / game_size).x
|
onready var window_scale :float = (OS.window_size / game_size).x
|
||||||
|
|
||||||
var _is_tracking :bool = true
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
func enable_tracking() -> void:
|
|
||||||
##TODO: add extra collission checks here to make sure we aren't stuck maybe?
|
|
||||||
_is_tracking = true
|
|
||||||
|
|
||||||
func disable_tracking() -> void:
|
|
||||||
_is_tracking = false
|
|
||||||
|
|
||||||
var flip_tracker = 0.0
|
var flip_tracker = 0.0
|
||||||
var stuck_check: bool
|
var stuck_check: bool
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
|
|
@ -20,6 +20,7 @@ extents = Vector2( 8, 40 )
|
||||||
points = PoolVector2Array( 20, 20, 0.326027, 20, 0.326027, 0.605103, 20, 0.605103 )
|
points = PoolVector2Array( 20, 20, 0.326027, 20, 0.326027, 0.605103, 20, 0.605103 )
|
||||||
|
|
||||||
[sub_resource type="TileSet" id=4]
|
[sub_resource type="TileSet" id=4]
|
||||||
|
resource_name = "NoCam"
|
||||||
0/name = "no_cam_tile.png 0"
|
0/name = "no_cam_tile.png 0"
|
||||||
0/texture = ExtResource( 6 )
|
0/texture = ExtResource( 6 )
|
||||||
0/tex_offset = Vector2( 0, 0 )
|
0/tex_offset = Vector2( 0, 0 )
|
||||||
|
|
@ -62,15 +63,15 @@ position = Vector2( 80, 131 )
|
||||||
damage_amount = 10
|
damage_amount = 10
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="Hitbox_Component" index="0"]
|
[node name="ColorRect" type="ColorRect" parent="Hitbox_Component" index="0"]
|
||||||
margin_left = 266.0
|
margin_left = 263.0
|
||||||
margin_top = 90.0
|
margin_top = 115.0
|
||||||
margin_right = 276.0
|
margin_right = 273.0
|
||||||
margin_bottom = 99.0
|
margin_bottom = 124.0
|
||||||
color = Color( 1, 0, 0, 1 )
|
color = Color( 1, 0, 0, 1 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="1"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="1"]
|
||||||
modulate = Color( 1, 0, 0, 1 )
|
modulate = Color( 1, 0, 0, 1 )
|
||||||
position = Vector2( 271, 94 )
|
position = Vector2( 268, 119 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="LevelTransition" parent="." index="5" instance=ExtResource( 4 )]
|
[node name="LevelTransition" parent="." index="5" instance=ExtResource( 4 )]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user