Heya,
After experimenting with LÖVE for a while, using Lua knowledge I learned via Roblox, I am now creating a basic platformer. I'm considering following Game Architecture & Design in college next year and so far, I'm liking it.
I tried using ATL and a collision system I found somewhere to build the basics, but I didn't understand either of them. After a few hours of thinking, I build the tile and movement from scratch myself and implementing collision didn't cause too much trouble. I don't have any plans for now, I'm just creating whatever I think fits in the game.
There's only 1 short level I made in Tiled a while ago. The blue pole marks the end of the level. If you can touch it, you win.
** Known bugs:
- When walking to the right, walls don't properly stop you. Instead, they bumb you back and forth.
- Triggers (Jumping springs) only detect the bottom-left pixel.
- When you collect a coin, a sound plays. If you collect another while the sound still plays, you won't hear another sound.
(If there's anyone who would like to help me with the collision/sound, I really appreciate it!)
All feedback and help is much appreciated!
I think I'm in love with LÖVE now
Basic platformer WIP - Demo
Basic platformer WIP - Demo
- Attachments
-
- PublicDemo1.zip
- Executable version in case you're using an older version of LÖVE.
- (8.31 MiB) Downloaded 213 times
-
- PlatformerWIP.love
- Build for LÖVE 0.9.0
- (150.58 KiB) Downloaded 310 times
Re: Basic platformer WIP - Demo
Very nice looking game so far! And welcome to the community!
I have some comments on the code:
Starting on line 314 of main.lua, and ending on line 621, you have:
I'm pretty sure this slows down the game speed a lot. Instead, use else-if statements!
You get the idea.
On line 630 of main.lua:
can also be
It's also a good habit to define arguments in the local space instead of globally (read why here if you want).
And I would highly recommend making a separate player.lua and enemy.lua, etc. files, simply for code cleanliness and manageability. Close to 1,000 lines of code is not something that is easy to edit...
Other than that, the code is very well written, so far as I can tell!
The game is also rather playable, considering it is the first!
I have some comments on the code:
Starting on line 314 of main.lua, and ending on line 621, you have:
Code: Select all
if MapTile[y][x] == number then
...
end
if MapTile[y][x] == number then
...
end
Code: Select all
if MapTile[y][x] == number1 then
...
elseif MapTile[y][x] == number2 then
...
elseif...
On line 630 of main.lua:
Code: Select all
if MapEntity[n].visible == true then
Code: Select all
if MapEntity[n].visible then
And I would highly recommend making a separate player.lua and enemy.lua, etc. files, simply for code cleanliness and manageability. Close to 1,000 lines of code is not something that is easy to edit...
Other than that, the code is very well written, so far as I can tell!
The game is also rather playable, considering it is the first!
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Basic platformer WIP - Demo
Hey, thank you very much!davisdude wrote:Very nice looking game so far! And welcome to the community!
I have some comments on the code:
...
Other than that, the code is very well written, so far as I can tell!
The game is also rather playable, considering it is the first!
Would moving the
Code: Select all
if MapTile[y][x] == number1 then
...
elseif MapTile[y][x] == number2 then
...
elseif... etc
Re: Basic platformer WIP - Demo
Looking good so far!
Moving them to a new file will not cause any slow down, no.
To fix the "moving right into a wall" bug, before you move the player forward, check to see if his new position will be colliding with the wall. If it is, don't move.
Moving them to a new file will not cause any slow down, no.
To fix the "moving right into a wall" bug, before you move the player forward, check to see if his new position will be colliding with the wall. If it is, don't move.
Code: Select all
player:move(x,y)
local pos = {
x = player.x + x,
y = player.y + y
}
if not checkCollision(pos) then
player.x = pos.x
player.y = pos.y
end
end
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests