Skip to content

Commit

Permalink
some improves
Browse files Browse the repository at this point in the history
  • Loading branch information
DOGamedev5 committed Nov 3, 2024
1 parent 425537d commit 26f62eb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
25 changes: 23 additions & 2 deletions dimensions/literatureArt/rooms/room6.tscn

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ transformation = "res://entities/player/powerStates/normal/playerNormal.tscn"
animation = "TRANSFORM"
animationTime = 0.8
animationPlayerPath = NodePath("AnimationTree")
offset = Vector2( 0, 64 )
fixedY = false
normalFilter = false

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
Expand Down
11 changes: 9 additions & 2 deletions objects/transform/transformClass.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export(String) var animation
export(float) var animationTime
export(NodePath) var animationPlayerPath
export var offset := Vector2.ZERO
export var fixedX := true
export var fixedY := true

export var normalFilter := true
var animationPlayer

Expand All @@ -18,8 +21,12 @@ func areaEntered(area):
return

Global.player.setCinematic(true)
Global.player.global_position = global_position + offset
Global.player.visible = false
if fixedX:
Global.player.global_position.x = global_position.x + offset.x

if fixedY:
Global.player.global_position.y = global_position.y + offset.y
# Global.player.visible = false
if animationPlayer is AnimationPlayer:
animationPlayer.play(animation)
yield(animationPlayer, "animation_finished")
Expand Down
4 changes: 2 additions & 2 deletions objects/tubeEnter/tubeEnter.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func _physics_process(_delta):
Global.player.pause_mode = Node.PAUSE_MODE_STOP
Global.player.active = false
Global.player.motion = Vector2.ZERO
Global.player.visible = false
# Global.player.visible = false
$Camera2D.current = true
$AnimationPlayer.play("enter")
yield($AnimationPlayer, "animation_finished")
Expand Down Expand Up @@ -88,7 +88,7 @@ func init():
$AnimationPlayer.play("enter")
yield($AnimationPlayer, "animation_finished")

Global.player.visible = true
# Global.player.visible = true
Global.player.camera.current = true
Global.player.moving = true
Global.player.active = true
Expand Down

0 comments on commit 26f62eb

Please sign in to comment.