Bonus Tutorial Finished.

This commit is contained in:
Alan Youngblood 2024-12-05 18:37:10 -05:00
parent 98c8da0338
commit a22832a709
10 changed files with 64 additions and 11 deletions

View File

@ -0,0 +1,10 @@
extends Camera2D
onready var topLeft = $Limits/TopLeft
onready var bottomRight = $Limits/BottomRight
func _ready():
limit_top = topLeft.position.y
limit_left = topLeft.position.x
limit_bottom = bottomRight.position.y
limit_right = bottomRight.position.x

View File

@ -0,0 +1,19 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Camera2D.gd" type="Script" id=1]
[node name="Camera2D" type="Camera2D"]
position = Vector2( 160, 90 )
current = true
smoothing_enabled = true
script = ExtResource( 1 )
[node name="Limits" type="Node" parent="."]
[node name="TopLeft" type="Position2D" parent="Limits"]
__meta__ = {
"_gizmo_extents_": 10.2
}
[node name="BottomRight" type="Position2D" parent="Limits"]
position = Vector2( 320, 180 )

View File

@ -5,7 +5,7 @@ const HitEffect = preload("res://Effects/HitEffect.tscn")
var invincible = false setget set_invincible var invincible = false setget set_invincible
onready var timer = $Timer onready var timer = $Timer
onready var collisionShape = $CollisionShape2D
signal invincibility_started signal invincibility_started
signal invincibility_ended signal invincibility_ended
@ -30,7 +30,7 @@ func _on_Timer_timeout():
self.invincible = false self.invincible = false
func _on_Hurtbox_invincibility_ended(): func _on_Hurtbox_invincibility_ended():
monitorable = true collisionShape.disabled = false
func _on_Hurtbox_invincibility_started(): func _on_Hurtbox_invincibility_started():
set_deferred("monitorable", false) collisionShape.set_deferred("disabled", true)

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -139,7 +139,7 @@
<script type='text/javascript' src='index.js'></script> <script type='text/javascript' src='index.js'></script>
<script type='text/javascript'>//<![CDATA[ <script type='text/javascript'>//<![CDATA[
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":2313264,"index.wasm":13790961},"focusCanvas":true,"gdnativeLibs":[]}; const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":2316416,"index.wasm":13790961},"focusCanvas":true,"gdnativeLibs":[]};
var engine = new Engine(GODOT_CONFIG); var engine = new Engine(GODOT_CONFIG);
(function() { (function() {

View File

@ -22,9 +22,11 @@ PlayerStats="*res://Player/PlayerStats.tscn"
window/size/width=320 window/size/width=320
window/size/height=180 window/size/height=180
window/size/test_width=1280 window/size/test_width=1920
window/size/test_height=720 window/size/test_height=1080
window/dpi/allow_hidpi=true
window/stretch/mode="2d" window/stretch/mode="2d"
window/stretch/aspect="keep"
[gui] [gui]