Skip to content

Commit

Permalink
block out more code when running in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
rosskarchner committed May 14, 2024
1 parent 483d66d commit 9554c11
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
21 changes: 11 additions & 10 deletions scenes/ball.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ var DIRECTION:=Vector2.ZERO


func _ready():
if phase == Palette.Phase.DAY:
DIRECTION = Vector2.LEFT + Vector2.DOWN
shapecast.collision_mask = 4
else:
DIRECTION = Vector2.RIGHT + Vector2.UP
shapecast.collision_mask = 8
DIRECTION.x *= randf()
DIRECTION.y *= randf()
DIRECTION = DIRECTION.normalized()
velocity = DIRECTION * SPEED
if not Engine.is_editor_hint():
if phase == Palette.Phase.DAY:
DIRECTION = Vector2.LEFT + Vector2.DOWN
shapecast.collision_mask = 4
else:
DIRECTION = Vector2.RIGHT + Vector2.UP
shapecast.collision_mask = 8
DIRECTION.x *= randf()
DIRECTION.y *= randf()
DIRECTION = DIRECTION.normalized()
velocity = DIRECTION * SPEED

func _draw():
draw_circle(Vector2.ZERO,12.5,Color.WHITE)
Expand Down
2 changes: 1 addition & 1 deletion scenes/block.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func flip():


func _input(event:InputEvent):
if event is InputEventMouseButton:
if not Engine.is_editor_hint() and event is InputEventMouseButton:
match event.button_mask:
MOUSE_BUTTON_MASK_RIGHT:
flip()
Expand Down
2 changes: 0 additions & 2 deletions scenes/board.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@ layer_0/tile_data = PackedInt32Array(14, 0, 65536, 15, 0, 65536, 16, 0, 65536, 1
[node name="DayBall" parent="." instance=ExtResource("1_v83i5")]
modulate = Color(0.85098, 0.909804, 0.890196, 1)
position = Vector2(270, 313)
velocity = Vector2(-278.293, 642.303)

[node name="NightBall" parent="." instance=ExtResource("1_v83i5")]
modulate = Color(0.0666667, 0.298039, 0.352941, 1)
position = Vector2(330, 313)
collision_layer = 2
collision_mask = 24
velocity = Vector2(530.072, -457.191)
phase = 1

0 comments on commit 9554c11

Please sign in to comment.