LoveCode, a makecode-like api for Lua

YEE
Hi! im working on (yes, its nowhere near finished) a lua port for makecode using love2d, i made it to help people get more familiar to non-block coding while still having a somewhat block like system so you can maybe learn javascript/python easier (python is very simmilar to lua BTW)

SOME DIFFERENCES:

  • no limitations with graphics, sound, performance, input, etc
  • not block coding (duh)
  • there is no built in editor, o you must use a code editor such as vscode, a sprite editor such as aseprite, and a song editor such as beepbox.
  • there are quite a bit of features missing due to it being a WIP, so you can only do simple things such as input, sprite defining, moving, displaying, so no collision, tilemaps, or sound yet (unless you want to code your own not with a mc api)
  • its not in your browser (duh again)
  • it updates at 60FPS instead of 30

also, i dont have a documentation built up yet, bc thats also a WIP :sweat_smile:

if you have any questions, comments, or just wanna know how to use this, please let me know!

LOVECODE

7 Likes

Cool! :0

2 Likes

Wow, Impressive.

3 Likes

2024-10-31 20-54-02.mkv [video-to-gif output image]
Working on collisions!
Expect an update soon! (as long as I don’t get stuck and/or distracted :sweat_smile:)

1 Like

aw man i didnt upload the gif right i used the link to the gif converter instead of actually uploading the gif :sob:

1 Like

Just wondering, would anyone actually use this? (i doubt)

  • Yes!
  • Maybe…
  • Nah.
  • Yes, if there was some sort of tutorial that i could learn off of.
0 voters
1 Like

yay heres a tutorial for those who wanna try!

REQUIRMENTS:

so lets first lets get some assets to use, im going to use https://opengameart.org/content/a-platformer-in-the-forest for my tilemap and ill just provide the lil log guy for the player (i havent implemented animations quite yet)

go to LoveCode’s project page on github and download it.

once lovecode is downloaded, extract the zip. now go into the folder and make sure these files are at the top of it

now, to see if everything is right, drag and drop that folder onto your love program (love.exe for windows, love.appimage for linux)
it should look something like this when it opens:

if it does, great! now we can move on.

now, download this image
player
and move it to assets/sprites in your lovecode folder.

next, lets go into our code.lua file in your code/text editor
it should look like this


now there is some premade code in there so lets get rid of that so we can use our own code!
it should look like this once your done:

now that we have a blank game, we can actually make it!
so first, we will make a new sprite called player in the function gameStart()

player={} --creates a new table, or blank sprite that is worthless
newSprite(player, "assets/sprites/player.png", "player") --we give it some worth

so it should look like this

now run your code.
OH NO!!! THERE IS JUST A BLANK SCREEN WITH NO PLAYER!!!
don’t worry, we just need to add two pieces of code to do that!
simply add updateSprites(player) to gameUpdate() and drawSprites(player) to gameDraw() so it looks like this:

now run your code to see your player on the screen!

now i dont know about you, but i think this game looks a little boring, so ill show you how to do more with it in the next post!

(sorry if this makes no sense, i wrote this up really fast and im tired.)

1 Like