summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Lopez Seijas <jorginho@riseup.net>2016-12-17 21:57:32 +0100
committerJorge Lopez Seijas <jorginho@riseup.net>2016-12-17 21:57:32 +0100
commit49b7a1b4f07515840212595dee16d277f186aeca (patch)
tree539a0d54a046bbd9eda8671a6588c027b4ed3179
parentcec52236adf5634e1e27b0c43880d0c257028eca (diff)
Comment some files and fix minor bug in load/default.lua
-rw-r--r--src/gnu_and_bola_brawlers/keypressed/default.lua4
-rw-r--r--src/gnu_and_bola_brawlers/load/character.lua2
-rw-r--r--src/gnu_and_bola_brawlers/load/default.lua2
-rw-r--r--src/gnu_and_bola_brawlers/load/images.lua2
-rw-r--r--src/gnu_and_bola_brawlers/load/player_controller_configuration.lua2
-rw-r--r--src/gnu_and_bola_brawlers/load/window_profile.lua2
-rw-r--r--src/gnu_and_bola_brawlers/main.lua2
-rw-r--r--src/gnu_and_bola_brawlers/meta_sprites/bola/jump.lua2
-rw-r--r--src/gnu_and_bola_brawlers/meta_sprites/bola/stand.lua2
-rw-r--r--src/gnu_and_bola_brawlers/meta_sprites/bola/walk.lua2
10 files changed, 20 insertions, 2 deletions
diff --git a/src/gnu_and_bola_brawlers/keypressed/default.lua b/src/gnu_and_bola_brawlers/keypressed/default.lua
index 26dea2f..07bb9bf 100644
--- a/src/gnu_and_bola_brawlers/keypressed/default.lua
+++ b/src/gnu_and_bola_brawlers/keypressed/default.lua
@@ -9,7 +9,7 @@ keypressed.trigger = function(character, images, metaSprite, controller, key, sc
character.actionA = true
character.actionDown = false
character.actionUp = false
- metaSprite = require 'meta_sprites/bola/jump'
+ metaSprite = character.jump
end
if scancode == controller.left then
@@ -27,6 +27,8 @@ keypressed.trigger = function(character, images, metaSprite, controller, key, sc
if scancode == controller.down and character.jump.isJumping == false then
character.actionDown = true
end
+
+ return metaSprite
end
return keypressed
diff --git a/src/gnu_and_bola_brawlers/load/character.lua b/src/gnu_and_bola_brawlers/load/character.lua
index 9339a38..5d2a6a4 100644
--- a/src/gnu_and_bola_brawlers/load/character.lua
+++ b/src/gnu_and_bola_brawlers/load/character.lua
@@ -1,3 +1,5 @@
+--[[ Contains parameters about the game characters ]]--
+
return {
bola = {
orientation = 0,
diff --git a/src/gnu_and_bola_brawlers/load/default.lua b/src/gnu_and_bola_brawlers/load/default.lua
index e85672a..b6d46f0 100644
--- a/src/gnu_and_bola_brawlers/load/default.lua
+++ b/src/gnu_and_bola_brawlers/load/default.lua
@@ -1,3 +1,5 @@
+--[[ Default function called from love.load() and initialize game parameters ]]--
+
local load = {}
load.initialize = function()
diff --git a/src/gnu_and_bola_brawlers/load/images.lua b/src/gnu_and_bola_brawlers/load/images.lua
index c7d30ff..d30826d 100644
--- a/src/gnu_and_bola_brawlers/load/images.lua
+++ b/src/gnu_and_bola_brawlers/load/images.lua
@@ -1,3 +1,5 @@
+--[[ Characters images that contains their meta sprites ]]--
+
return {
bola = {
love.graphics.newImage('/multimedia/ppu_rp2c0x/meta_sprites/bola/default_sheet_color0_alpha.png'),
diff --git a/src/gnu_and_bola_brawlers/load/player_controller_configuration.lua b/src/gnu_and_bola_brawlers/load/player_controller_configuration.lua
index ec6c99e..51e64c4 100644
--- a/src/gnu_and_bola_brawlers/load/player_controller_configuration.lua
+++ b/src/gnu_and_bola_brawlers/load/player_controller_configuration.lua
@@ -1,3 +1,5 @@
+--[[ Contains the players controllers and translate physic button (keyboard, gamepad, etc.) to a NES button name. ]]--
+
return {
player1 = {
left = 'a',
diff --git a/src/gnu_and_bola_brawlers/load/window_profile.lua b/src/gnu_and_bola_brawlers/load/window_profile.lua
index 0f6d928..f6fa4b4 100644
--- a/src/gnu_and_bola_brawlers/load/window_profile.lua
+++ b/src/gnu_and_bola_brawlers/load/window_profile.lua
@@ -1,3 +1,5 @@
+--[[ Contains general parameters about the window ]]--
+
return {
mode = {
width = 256,
diff --git a/src/gnu_and_bola_brawlers/main.lua b/src/gnu_and_bola_brawlers/main.lua
index e8f76f7..40299a5 100644
--- a/src/gnu_and_bola_brawlers/main.lua
+++ b/src/gnu_and_bola_brawlers/main.lua
@@ -5,7 +5,7 @@ end
function love.keypressed(key, scancode)
local keypressed = require 'keypressed/default'
- keypressed.trigger(character.bola, images.bola, metaSprite.bola, controller.player1, key, scancode)
+ metaSprite.bola = keypressed.trigger(character.bola, images.bola, metaSprite.bola, controller.player1, key, scancode)
end
function love.keyreleased(key, scancode)
diff --git a/src/gnu_and_bola_brawlers/meta_sprites/bola/jump.lua b/src/gnu_and_bola_brawlers/meta_sprites/bola/jump.lua
index ad98578..8543cf5 100644
--- a/src/gnu_and_bola_brawlers/meta_sprites/bola/jump.lua
+++ b/src/gnu_and_bola_brawlers/meta_sprites/bola/jump.lua
@@ -1,3 +1,5 @@
+--[[ Collection of sprites and parameters to perform the jump movement ]]--
+
return {
love.graphics.newQuad(images.bola.x * 5, images.bola.y * 2, images.bola.x, images.bola.y, images.bola[1]:getDimensions()),
currentFrame = 1,
diff --git a/src/gnu_and_bola_brawlers/meta_sprites/bola/stand.lua b/src/gnu_and_bola_brawlers/meta_sprites/bola/stand.lua
index 1c21792..c9d678d 100644
--- a/src/gnu_and_bola_brawlers/meta_sprites/bola/stand.lua
+++ b/src/gnu_and_bola_brawlers/meta_sprites/bola/stand.lua
@@ -1,3 +1,5 @@
+--[[ Collection of sprites that is necessary to perform character while is motionless ]]--
+
return {
love.graphics.newQuad(images.bola.x * 0, images.bola.y * 0, images.bola.x, images.bola.y, images.bola[1]:getDimensions()),
love.graphics.newQuad(images.bola.x * 0, images.bola.y * 0, images.bola.x, images.bola.y, images.bola[1]:getDimensions()),
diff --git a/src/gnu_and_bola_brawlers/meta_sprites/bola/walk.lua b/src/gnu_and_bola_brawlers/meta_sprites/bola/walk.lua
index 36f42e3..8262e5e 100644
--- a/src/gnu_and_bola_brawlers/meta_sprites/bola/walk.lua
+++ b/src/gnu_and_bola_brawlers/meta_sprites/bola/walk.lua
@@ -1,3 +1,5 @@
+--[[ Collection of sprites that is necessary to perform walking movement gestures ]]--
+
return {
love.graphics.newQuad(images.bola.x * 0, images.bola.y * 1, images.bola.x, images.bola.y, images.bola[1]:getDimensions()),
love.graphics.newQuad(images.bola.x * 1, images.bola.y * 1, images.bola.x, images.bola.y, images.bola[1]:getDimensions()),