I just would like to showcase what I’ve been working on in the past few weeks.
It is nothing out of ordinary, not even a game really, just a very basic platformer engine at this point.
This is how it currently looks (gif):
Basically what you see is 8 type of content:
- Single Sprite
Tiled Sprite
Animated Sprite
Platformer Player
Platformer Solid
Platformer Platform
Platformer Ladder
Platformer Movable
The Player character is animated and can:
- Walk
Jump
Push obstacles
Pull obstacles
Grab the edge of platforms
Climb ladders
Jump off ladders
Collide
- Fall to the ground
Stack on top of each other
Move/Slide on the ground and also on top of each other
Movement can be disabled so the player can not move it.
Collide
- Move and carry the player character with them
Movement can be disabled.
Player can jump through but can be disabled.
Player can grab the edge but can be disabled.
Can also behave like a solid with everything disabled.
It is also pretty easy to code, I have implemented methods and properties so it is easy to work with.
To get an idea, the high level code for what you see is looks like this:
Code: Select all
local AnimatedSprite = require 'AnimatedSprite'
local Sprite = require 'Sprite'
local TiledSprite = require 'TiledSprite'
local Platformer = require 'Platformer'
local ground
local player
local pfe
local ladder
local platform
function love.load(arg)
ground = TiledSprite:new('Images/grassMid.png',20,1)
ground:setPosition(0,700)
player = AnimatedSprite:new()
player:addFrameToAnimation('stand', 'Images/Player/p1_stand.png')
player:addFrameToAnimation('jump', 'Images/Player/p1_jump.png')
player:addFrameToAnimation('fall', 'Images/Player/p1_jump.png')
for i = 1, 11, 1 do
player:addFrameToAnimation('walkR', 'Images/Player/walk/p1_walk'..i..'.png')
end
for i = 11, 1, -1 do
player:addFrameToAnimation('walkL', 'Images/Player/walk/p1_walk'..i..'.png')
end
player:setPosition(200,500)
player:setScale(0.8,0.8)
ladder = TiledSprite:new('Images/ladder_mid.png',1,4)
ladder:setPosition(600,420)
platform = TiledSprite:new('Images/bridge.png',2,1)
platform:setPosition(700,550)
pfe = Platformer:new()
pfe:setPlayer(player)
pfe:setSolid(ground)
pfe:setMovable(createBox(600,630))
pfe:setMovable(createBox(400,630))
pfe:setMovable(createBox(250,500))
pfe:setLadder(ladder)
pfe:setPlatform(platform)
platform.canJumpThrough = true
end
function love.update(dt)
pfe:update(dt)
if player.isMoveRight and player.isJump == false and player.isFall == false then
player:setAnimationByName('walkR')
end
if player.isMoveLeft and player.isJump == false and player.isFall == false then
player:setAnimationByName('walkL')
end
if player.isJump and player.isMove == false then player:setAnimationByName('jump') end
if player.isMove == false and player.isJump == false and player:getAnimationName() ~= 'stand' then player:setAnimationByName('stand') end
if player.isFall and player:getAnimationName() ~= 'fall' then player:setAnimationByName('fall') end
player:updateAnimation(dt)
if love.keyboard.isDown('i') then platform:moveUp(dt) end
if love.keyboard.isDown('k') then platform:moveDown(dt) end
if love.keyboard.isDown('j') then platform:moveLeft(dt) end
if love.keyboard.isDown('l') then platform:moveRight(dt) end
if love.keyboard.isDown('p') then platform.isPaused = true end
if love.keyboard.isDown('g') then platform.isPaused = false end
end
function love.draw()
pfe:draw()
end
function createBox(_x, _y)
local box = Sprite:new('Images/box.png')
box:setPosition(_x,_y)
box:setScale(1,1)
return box
end
I don’t know at the moment what direction to go with this. I am kind of stuck. I don’t actually have any idea for a game. I have done this only to get my feet wet with LÖVE and wanted to try something I have never done before and code as much on my own as I can without using any 3rd party lib.
Guess I could add some enemies, weapons, tons of other features but I am lack inspiration at the moment.
I am also considering to release this as some sort of open-source “Platformer Framework” but I'm not so sure if it would be any useful to anyone, after all the entire point of frameworks like LÖVE is to do it your own.
So any feedback and idea what to do with this would be appretiated
Thanks.