Try-Lua
A lua sandbox running right on your browser.
Available at https://lua.ceifa.dev
IDE - Gly Game Engine
playground to code your lua games directly in the browser!
* change: start use gridsystem * change: add gly game engine
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: rodrigodornelles |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: cd | ||
|
||
env: | ||
CLOUDFLARE_PROJECT_TRYLUA: ide-gly | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
pages: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' || github.event.pull_request.draft == false | ||
steps: | ||
- | ||
uses: actions/checkout@master | ||
- | ||
run: | | ||
npm install | ||
- | ||
run: | | ||
npm run build | ||
- | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'workflow_dispatch' | ||
uses: cloudflare/pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: ${{ env.CLOUDFLARE_PROJECT_TRYLUA }} | ||
directory: dist |
A lua sandbox running right on your browser.
Available at https://lua.ceifa.dev
playground to code your lua games directly in the browser!
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,58 @@ | ||
html { | ||
overflow: hidden; | ||
} | ||
|
||
html, body { | ||
*, *::after, *::before { | ||
touch-action: none; | ||
box-sizing: border-box; | ||
border: 0; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
main { | ||
font-family: "Cascadia Code"; | ||
display: flex; | ||
align-items: stretch; | ||
height: 100vh; | ||
width: 100%; | ||
} | ||
|
||
pre { | ||
font-family: "Cascadia Code"; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
@media (max-width: 1000px) { | ||
main { | ||
flex-direction: column; | ||
} | ||
display: grid; | ||
width: 100vw; | ||
height: 99.9vh; | ||
overflow: hidden; | ||
} | ||
|
||
#editor { | ||
flex: 1; | ||
#buttons { | ||
grid-area: buttons; | ||
} | ||
|
||
.tip { | ||
position: absolute; | ||
bottom: 1em; | ||
left: 1em; | ||
z-index: 5; | ||
color: white; | ||
display: flex; | ||
flex-direction: column; | ||
#output { | ||
grid-area: output; | ||
} | ||
|
||
#current-action { | ||
color: #888888; | ||
margin-bottom: 1rem; | ||
#game { | ||
grid-area: game; | ||
background-color: black; | ||
} | ||
|
||
#output { | ||
flex: 1; | ||
background-color: rgb(13, 16, 30); | ||
color: white; | ||
padding: 10px; | ||
overflow: auto; | ||
#editor { | ||
grid-area: editor; | ||
} | ||
|
||
.github { | ||
position: absolute; | ||
bottom: 1em; | ||
right: 1em; | ||
z-index: 5; | ||
#game canvas { | ||
width: 100%; | ||
} | ||
|
||
.github a { | ||
color: wheat; | ||
@media (max-width: 700px) { | ||
main { | ||
grid-template-areas: | ||
"buttons buttons" | ||
"game output" | ||
"editor editor"; | ||
} | ||
} | ||
|
||
@media (max-width: 1000px) { | ||
#divider { | ||
width: auto !important; | ||
height: 4px; | ||
@media (min-width: 700px) { | ||
#editor { | ||
height: 90vh; | ||
} | ||
|
||
.tip { | ||
display: none; | ||
main { | ||
grid-template-columns: 2fr 2fr; | ||
grid-template-rows: auto 1fr 1fr; | ||
grid-template-areas: | ||
"buttons buttons" | ||
"editor game" | ||
"editor output"; | ||
} | ||
} | ||
|
||
#divider { | ||
width: 4px; | ||
background-color: #444444; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
function fibonacci(n) | ||
local current, next = 0, 1 | ||
local function init(std, game) | ||
end | ||
|
||
for i = 1, n do | ||
print(current) | ||
current, next = next, current + next | ||
end | ||
local function loop(std, game) | ||
end | ||
|
||
return current | ||
local function draw(std, game) | ||
std.draw.clear(std.color.blue) | ||
std.draw.color(std.color.black) | ||
std.draw.text(8 , 8, 'Hello world!') | ||
end | ||
|
||
fibonacci(20) | ||
local function exit(std, game) | ||
end | ||
|
||
local P = { | ||
meta={ | ||
title='Hello world', | ||
author='RodrigoDornelles', | ||
description='say hello to the world!', | ||
version='1.0.0' | ||
}, | ||
callbacks={ | ||
init=init, | ||
loop=loop, | ||
draw=draw, | ||
exit=exit | ||
} | ||
} | ||
|
||
return P |