-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
86 additions
and
86 deletions.
There are no files selected for viewing
100 changes: 50 additions & 50 deletions
100
Mygames/Character Movement/main.lua → Character Movement/main.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.