Skip to content

Commit

Permalink
Fixed #1
Browse files Browse the repository at this point in the history
Also fixed a weird behavior when playing a note and then moving, now the character only moves if is not playing and vice versa. This also adds another layer of control for basic_character.gd since now if the character can't move, nothing of the physics_process will happen
  • Loading branch information
henriiquecampos committed Mar 5, 2018
1 parent 3a05709 commit 773946e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -2,3 +2,7 @@
*.TMP
*.tres~HEAD
*.tscn~HEAD
*.stex
*.sample
*.oggstr
export_presets.cfg
3 changes: 3 additions & 0 deletions actors/basic_character.gd
Expand Up @@ -7,12 +7,15 @@ const JUMP_HEIGHT = -1400
var velocity = Vector2()
var can_jump = true
var falling = false
var can_move = true
onready var init_scale = $Sprites.get_scale()

enum STATES{IDLE, WALK, JUMP}
var current_state = IDLE setget set_current_state, get_current_state

func _physics_process(delta):
if !can_move:
return
velocity.y += GRAVITY
velocity = move_and_slide(velocity, UP)

Expand Down
5 changes: 4 additions & 1 deletion actors/player/bard/bard.gd
Expand Up @@ -40,11 +40,14 @@ func _process(delta):
if !check:
miss()
object.miss()
if Input.is_action_just_released("interact") and note != null and can_interact:
if Input.is_action_just_released("interact") and can_interact:
can_move = true
if note == null:
return
var pitch = key
var duration = note.duration
note.finished()

if object != null:
if check_duration(duration, object.note_duration) and check:
success()
Expand Down
1 change: 0 additions & 1 deletion actors/player/player_character.gd
@@ -1,5 +1,4 @@
extends "res://actors/basic_character.gd"
var can_move = true
func _physics_process(delta):
if !can_move:
return
Expand Down
9 changes: 9 additions & 0 deletions interface/note_duration/note.tscn
Expand Up @@ -98,6 +98,15 @@ playback/speed = 1.0
position = Vector2( 3.34721, 0 )
texture = ExtResource( 1 )
[node name="LifeSpam" type="Timer" parent="." index="3"]
process_mode = 1
wait_time = 2.0
one_shot = true
autostart = true
[connection signal="texture_changed" from="Sprite" to="." method="_on_texture_changed"]
[connection signal="timeout" from="LifeSpam" to="." method="finished"]
2 changes: 1 addition & 1 deletion levels/level_01/level_01.tscn
Expand Up @@ -25,7 +25,7 @@ custom_solver_bias = 0.0
normal = Vector2( 0, -1 )
d = 0.0

[node name="Level_01" instance=ExtResource( 1 )]
[node name="Level_01" index="0" instance=ExtResource( 1 )]

[node name="Tilemap" parent="." index="0"]

Expand Down
2 changes: 1 addition & 1 deletion screens/splash_screen/splash_screen.tscn
Expand Up @@ -9,7 +9,7 @@
[ext_resource path="res://screens/splash_screen/twitter.png" type="Texture" id=7]
[ext_resource path="res://screens/splash_screen/itch.png" type="Texture" id=8]

[node name="SplashScreen" index="0" instance=ExtResource( 1 )]
[node name="SplashScreen" instance=ExtResource( 1 )]

next_scene = "res://screens/main_screen/main_screen.tscn"

Expand Down

0 comments on commit 773946e

Please sign in to comment.