Skip to content

Commit 5e21deb

Browse files
committed
Avoide zero delta
1 parent 6db2af7 commit 5e21deb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • external_library/java/handy/library/balls

external_library/java/handy/library/balls/balls.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ class Ball
77
def initialize(sketch, id)
88
@sketch = sketch
99
@position = Vec2D.new rand(100..300), rand(100..300)
10-
@delta = Vec2D.new rand(-6..6), rand(-6..6)
10+
@delta = Vec2D.new rand(0.1..6), rand(0.1..6)
11+
@delta *= -1 if rand > 0.5
1112
@size = rand(60..100)
1213
radius = @size / 2.0
1314
@color = BALL_COLORS[id % BALL_COLORS.size]

0 commit comments

Comments
 (0)