I work on cmake alternative for raylib project, config free. You can export c/c++ project on web with it. Linux build is publish, window build is WIP.
Magnus Oblerion
Creator of
Recent community posts
a1.5
Main
loop function
function EGBA()
-- your code run 60/seconds
end
log
trace("hi")
-- print hi in console (only string)
local v=2 print("value :",v)
-- lua print function can be used to view variable value in console
palette swap
pal(2)
-- id 0 -> 4, change curant palette
-- for all function after with id color
Graphics
clear screen
cls(0)
-- clear screen with id color 0
print text
text("hello world",23,23,0,16)
-- x 23, y 23, id color 0,font size 16
draw rectangle
rect(23,23,50,50,2)
-- draw fill rectangle in x 23, y 23, width 50, height 50, id color 2
rectb(23,23,50,50,2)
-- draw line rectangle in x 23, y 23, width 50, height 50, id color 2
draw pixel
pix(10,10,2)
-- draw pixel in x 10,y 10, id color 2
draw sprite
spr(1,23,23,2)
-- draw sprite id 1,x 23,y 23,scale 2
Input
keyboard
if btn(0) then
-- if key down is down
elseif btn(1) then
-- if key up is down
end
if btnp(2) then
-- if key left is pressed
elseif btnp(3) then
-- if key right is pressed
end
-- id 0 : down, 1 : up, 2 : left, 3 : right, 4 : x, 5 : c
-- btn -> btn is down
-- btnp -> btn is pressed
mouse
local x,y,btnl,btnm,btnr = mouse()
-- x = x mouse
-- y = y mouse
-- btnl = true/false mouse left button
-- btnm = true/false mouse mid button
-- btnr = true/false mouse right button
a0.1
Main
loop function
function EGBA()
-- your code run 60/seconds
end
log
trace("hi")
-- print hi in console
Graphics
clear screen
cls(0)
-- clear screen with color 0 of first palette
print text
print("hello world",23,23,0,16)
-- x 23, y 23, id color 0,font size 16
draw rectangle
rect(23,23,50,50,2)
-- draw fill rectangle in x 23, y 23, width 50, height 50, id color 2
rectb(23,23,50,50,2)
-- draw line rectangle in x 23, y 23, width 50, height 50, id color 2
draw sprite
spr(1,23,23,2)
-- draw sprite id 1,x 23,y 23,scale 2
Input
keyboard
if btn(0) then
-- if key down is down
elseif btn(1) then
-- if key up is down
end
if btnp(2) then
-- if key left is pressed
elseif btnp(3) then
-- if key right is pressed
end
-- id 0 : down, 1 : up, 2 : left, 3 : right
-- btn -> btn is down
-- btnp -> btn is pressed
mouse
local x,y,btnl,btnm,btnr = mouse()
-- x = x mouse
-- y = y mouse
-- btnl = true/false mouse left button
-- btnm = true/false mouse mid button
-- btnr = true/false mouse right button
Bonjour, glad to see another Frenchman. I’ve never played on the amiga or megadrive, but I like the look of an old games console.
I’m going to make a devlog with more information on how it works together c++/raylib/emscripten .
It’s not very intuitive and it requires some adaptation from classic c++.
This gameplay is a part of big game i want to do.
a1.5
Setup new project
- Download palette image .png <= 32 color lospec.com
- on browser touch « + » , it create new.lua and new.png
- click on « new » project, click on « spr » button
- drag and drop palette image to window
- save, quit and rename new .lua/.png with your projet name
Debug (GUI)
- load projet with browser
- press space for start/stop debug
Create EGBA from script/sprite
- After load projet , « -> » button or ctrl + e
- ctrl + l for locked egba (can’t import lua/spr from egba)
Import sprite/script from EGBA
After load projet , « <- » button or ctrl + i
Run EGBA (GUI)
After load projet, press enter for start/stop running EGBA
Build standalone game from EGBA
After load projet, ctrl + b
If you have egba and egba.exe, it create binairy for linux (no ext) and window (.exe)
Debug (CLI)
open cmd, tape it
egba.exe project.lua
it use .png for load color and sprite
Run (CLI)
open cmd, tape it
egba.exe project.egba
Load spritesheet
- drag and drop 256x256 img, it to browser→project→spr
- drag and drop 256x257 img, it to browser→project→spr
a0.1
setup cartbridge .egba
-
Download palette image .png <= 32 color lospec.com
-
launch egba.exe
-
drag and drop image to window
-
btn save create save.egba next to egba.exe, rename it with your project name
load .egba
- launch egba.exe
- drag and drop it to editor
lua script
- create .lua next your .egba with same name.
- edit it with it
-- hello world example
function EGBA()
print("hello world",50,50,1,20)
end
launch external script
- open cmd, tape it
egba.exe project.lua
it use .egba for load color and sprite
load script to cartbridge
- launch egba.exe -> script section
- drag and drop it to editor
export spritesheet
- goto sprite section
- ctrl + E
load spritesheet
- drag and drop it to editor
launch cartbridge with intern script
- open cmd, tape it
egba.exe project.egba
build standalone game.exe
- launch egba.exe
- load cartbridge ,goto script section
- right ctrl+B -> project.exe
build game.exe work only for window , not with wine
Demake of clash of heroes might and magic 64x64.
https://itch.io/jam/lowrezjam-2023/rate/2215676
Tips and advice:
Learning unity can take a long time before you can make finished games. Without being able to reuse your knowledge on other tools. You can use the love2d or pygame framework for your first games. Make prototypes with fantasy consoles like pico8 or tic80.
Reviews:
I love sound and transformation effects. Some text button in the UI is too small, it’s easy to miss a click. The story gives a good idea of what you wanted to do. That can be good game in future.
If your looking for teamate for next gamejam, i am.
Tout ces projets sont baser sur emscripten, son défaut est qu'il ne peut pas convertir tout le code. Je l'ai tester avec du c/raylib, il ne prend pas en charge certaine fonctionnalités.
Je prend uniquement api js de base et je la modifie pour qu'elle ressemble à love.
C'est bien plus simple mais certaine fonction sont trop différente de love pour être convertie pour l'instant.
Je vous conseille d'aller regarder le code de certaine cartouche pico8 qui sont des projet fini.
Ils abusent des fonctions poke() et peek() qui permette de coder directement les échange avec la ram.
Et de changer de palette ou de jeux de sprite entre deux draw call.
C'est le plus gros défaut de la pico8, il faut coder un système de swap ... alors que la tic80 en a un dans son api.
Le code bien mieux structuré, j'ai appris à utiliser l' url en base64 pour intégrer le script/asset dans la page sans temps de chargement.
Le framework nécessite des améliorations, la partie graphique me pose problème ( intégration d'animation , lumière) .
Je ne maîtrise pas suffisamment la création de comportement d'ordi pour l'utiliser ici.
Note : Passer plusieurs jour sur l'intégration d'un système d'effet de lumière étais vraiment pas une bonne idée,
yo , i enjoy your com . if you want to speak about web dev , go in my discord server https://discord.gg/7tYRreMJ.
this most easy to share some code.