Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pong-10/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
end

--[[
Expand Down Expand Up @@ -54,8 +54,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down
8 changes: 4 additions & 4 deletions pong-11/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
end

--[[
Expand Down Expand Up @@ -54,8 +54,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down
8 changes: 4 additions & 4 deletions pong-12/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
end

--[[
Expand Down Expand Up @@ -54,8 +54,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down
8 changes: 4 additions & 4 deletions pong-5/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand All @@ -33,8 +33,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down
8 changes: 4 additions & 4 deletions pong-6/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down Expand Up @@ -54,8 +54,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down
8 changes: 4 additions & 4 deletions pong-7/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
end

--[[
Expand Down Expand Up @@ -54,8 +54,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down
8 changes: 4 additions & 4 deletions pong-8/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
end

--[[
Expand Down Expand Up @@ -54,8 +54,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down
8 changes: 4 additions & 4 deletions pong-9/Ball.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function Ball:init(x, y, width, height)

-- these variables are for keeping track of our velocity on both the
-- X and Y axis, since the ball can move in two dimensions
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(2) == 1 and math.random(-80, -100) or math.random(80, 100)
end

--[[
Expand Down Expand Up @@ -54,8 +54,8 @@ end
function Ball:reset()
self.x = VIRTUAL_WIDTH / 2 - 2
self.y = VIRTUAL_HEIGHT / 2 - 2
self.dy = math.random(2) == 1 and -100 or 100
self.dx = math.random(-50, 50)
self.dx = math.random(2) == 1 and -100 or 100
self.dy = math.random(-50, 50)
end

--[[
Expand Down