Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guilleatm/love2d-utils
Useful libraries for making games with love2d
https://github.com/guilleatm/love2d-utils
game-development gamedev love2d love2d-framework love2d-library
Last synced: about 2 months ago
JSON representation
Useful libraries for making games with love2d
- Host: GitHub
- URL: https://github.com/guilleatm/love2d-utils
- Owner: guilleatm
- License: mit
- Created: 2020-10-27T12:12:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-01T20:08:33.000Z (over 4 years ago)
- Last Synced: 2024-10-31T04:24:37.324Z (3 months ago)
- Topics: game-development, gamedev, love2d, love2d-framework, love2d-library
- Language: Lua
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Using the repo
Clone repo (and submodules): git clone --recurse-submodules https://github.com/guilleatm/love2d-utils.git
Update repo (and submodules): git submodule update --remote
Push repo (and submodules): git add, commit and push for each submodule, then for the project
> Use: git submodules foreach 'git command' for executing the same command in each submodule# Useful code for making games with Löve2D
[Löve2D web](https://love2d.org/wiki/Main_Page)
## Animations
Download Animation.lua for making this work (and the .png)
```lua
-- main.luarequire 'Animation'
function love.load()
love.graphics.setDefaultFilter("nearest", "nearest") -- Not necessary, it is for loading correctly pixelart images.local img = love.graphics.newImage("oldHero.png") -- Sprite size --> 16 x 18
myAnimation = Animation:new(img, 16, 18, 0.5, true) -- The animation takes 0.5 seconds and loops until myAnimation:stop()
myAnimation:setScale(8) -- The drawn image is 8 times bigger than the real size.
myAnimation:addCallback(5, function() print("I am called in the frame 5!!") end) -- Each time the animation reaches the 5 frame, this function is called.
myAnimation:start() -- Starts the animation.
endfunction love.update(dt)
myAnimation:update(dt) -- Remember the update and the draw!!
endfunction love.draw()
myAnimation:draw(200, 200) -- Remember the update and the draw!!
end
```## Tilemaps
Create your own tilemaps with this library!!
## Utils
Useful functions for your games (a bit random)
## Camera
Simple and useful camera (not mine)
## Pathfinding (A*)
[Pathfinding Algorithm A*](https://github.com/lattejed/a-star-lua) (not mine)