Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
shelltitan committed Mar 11, 2017
2 parents cba412b + c730b20 commit c820e74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/actors/player/ship/ship.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ var speed = Vector2(0, 0)
var motion_factor = Vector2(1, 1) # multiplies base motion
var root_motion = Vector2(0, 0) # applyed to base motion

# Shoot delay
var shoot_delay_sec = 0.3

# Coin
const coin_type = preload("res://src/objects/rewards/reward.gd")

Expand All @@ -51,7 +54,8 @@ func _process(delta):
motion += Vector2(1, 0)
# Input: SHOOT
# REMOVED FOR 2.1 Stable: if(Input.is_action_just_pressed("shoot")):
if(Input.is_action_pressed("shoot")):
if(Input.is_action_pressed("shoot") && timer.get_time_left()<=0):
timer.start()
# Create a new shot instance
var shot = preload("shot.tscn").instance()

Expand Down Expand Up @@ -89,12 +93,17 @@ func _process(delta):
# Set new player position
set_pos(pos)


var timer = null
# Start
func _ready():
# Screen size is used to calculate whether or not the player is inside it
screen_size = get_viewport().get_rect().size

timer = Timer.new()
add_child(timer)
timer.set_one_shot(true)
timer.set_wait_time(shoot_delay_sec)

# Enable process
set_process(true)

Expand Down
Binary file modified src/objects/platforms/moving_platform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c820e74

Please sign in to comment.