Skip to content

Commit

Permalink
reorganized file
Browse files Browse the repository at this point in the history
  • Loading branch information
Grubs8 committed Aug 7, 2023
1 parent f10575e commit 4e4c6a7
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 86 deletions.
100 changes: 50 additions & 50 deletions Mygames/Character Movement/main.lua → Character Movement/main.lua
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
-- push = require 'push'
WINDOW_HEIGHT = 720
WINDOW_WIDTH = 1280

function love.load()
love.window.setMode(WINDOW_WIDTH, WINDOW_HEIGHT, {
fullscreen = false,
resizable = true,
vsync = true
})
player = {}
player.x = WINDOW_WIDTH / 2
player.y = WINDOW_HEIGHT / 2
player.speed = 3
player.sprite = love.graphics.newImage('sprites/parrot.png')
background = love.graphics.newImage('sprites/SkeletonWarrior.jpg')

math.randomseed(os.time())

end

function love.update(dt)
input()
end

function love.draw()
love.graphics.draw(background, 0, 0)
love.graphics.draw(player.sprite, player.x, player.y)

end

function input()

if love.keyboard.isDown("right") then
player.x = player.x + player.speed
end
if love.keyboard.isDown("left") then
player.x = player.x - player.speed
end
if love.keyboard.isDown("up") then
player.y = player.y - player.speed
end
if love.keyboard.isDown("down") then
player.y = player.y + player.speed
end
if love.keyboard.isDown("escape") then
love.event.quit()
end
end

-- push = require 'push'
WINDOW_HEIGHT = 720
WINDOW_WIDTH = 1280

function love.load()
love.window.setMode(WINDOW_WIDTH, WINDOW_HEIGHT, {
fullscreen = false,
resizable = true,
vsync = true
})
player = {}
player.x = WINDOW_WIDTH / 2
player.y = WINDOW_HEIGHT / 2
player.speed = 3
player.sprite = love.graphics.newImage('sprites/parrot.png')
background = love.graphics.newImage('sprites/SkeletonWarrior.jpg')

math.randomseed(os.time())

end

function love.update(dt)
input()
end

function love.draw()
love.graphics.draw(background, 0, 0)
love.graphics.draw(player.sprite, player.x, player.y)

end

function input()

if love.keyboard.isDown("right") then
player.x = player.x + player.speed
end
if love.keyboard.isDown("left") then
player.x = player.x - player.speed
end
if love.keyboard.isDown("up") then
player.y = player.y - player.speed
end
if love.keyboard.isDown("down") then
player.y = player.y + player.speed
end
if love.keyboard.isDown("escape") then
love.event.quit()
end
end

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
72 changes: 36 additions & 36 deletions Mygames/Pong/Pong-0/main.lua → Pong/Pong-0/main.lua
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
--[[
GD50 2018
Pong Remake
pong-0
"the Day-0 Update"
-- Main Program ---
Author: Andrew Gibson
[email protected]
Priginally programmed by Atari in 1972. Features two
paddles, controlled by players, with the goal of getting
the ball past your opponent's edge. First to 10 points wins.
]] WINDOW_WIDTH = 1280;
WINDOW_HEIGHT = 720;

--[[
Runs when the game first starts up, only once; used to initialize the game.
]]
function love.load()
love.window.setMode(WINDOW_WIDTH, WINDOW_HEIGHT, {
fullscreen = false,
resizable = true,
vsync = true
})
end

--[[
Called after update by LOVE2D, used to draw anything to the screen, updated or otherwise.
]]
function love.draw()
love.graphics.printf('Hello Pong!', 0, WINDOW_HEIGHT / 2 - 6, WINDOW_WIDTH, 'center');
end

--[[
GD50 2018
Pong Remake
pong-0
"the Day-0 Update"
-- Main Program ---
Author: Andrew Gibson
[email protected]
Priginally programmed by Atari in 1972. Features two
paddles, controlled by players, with the goal of getting
the ball past your opponent's edge. First to 10 points wins.
]] WINDOW_WIDTH = 1280;
WINDOW_HEIGHT = 720;

--[[
Runs when the game first starts up, only once; used to initialize the game.
]]
function love.load()
love.window.setMode(WINDOW_WIDTH, WINDOW_HEIGHT, {
fullscreen = false,
resizable = true,
vsync = true
})
end

--[[
Called after update by LOVE2D, used to draw anything to the screen, updated or otherwise.
]]
function love.draw()
love.graphics.printf('Hello Pong!', 0, WINDOW_HEIGHT / 2 - 6, WINDOW_WIDTH, 'center');
end

File renamed without changes.

0 comments on commit 4e4c6a7

Please sign in to comment.