Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: node component system #106

Merged
merged 32 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4ca21a2
refact: starting break changes
RodrigoDornelles Oct 17, 2024
def7c5a
wip
RodrigoDornelles Oct 17, 2024
ca6be37
sextou!
RodrigoDornelles Oct 18, 2024
1527db6
wip: segundougit status!
RodrigoDornelles Oct 21, 2024
6e14587
fix: pause when window blur #102
RodrigoDornelles Oct 22, 2024
10c7685
fix: floor math random params #101
RodrigoDornelles Oct 22, 2024
1ee2022
docs: alias startmath
RodrigoDornelles Oct 22, 2024
445125a
style: some fixes in luau-analyze linter
RodrigoDornelles Oct 22, 2024
23c55f6
wip: ginga (missing fps controller)
RodrigoDornelles Oct 23, 2024
8b27eff
wip: ginga
RodrigoDornelles Oct 24, 2024
31f4a8d
feat: font size in text_tui ginga
RodrigoDornelles Oct 24, 2024
fb1e32a
wip: pong
RodrigoDornelles Oct 24, 2024
6290725
change: remove csv support
RodrigoDornelles Oct 24, 2024
b8f776b
chore: tests
RodrigoDornelles Oct 24, 2024
7426e7d
wip: start refact http
RodrigoDornelles Oct 24, 2024
2790985
wip: fix i18n and another linter issues
RodrigoDornelles Oct 24, 2024
42a47ab
feat: std.bus.abort
RodrigoDornelles Oct 24, 2024
d91f13c
feat: separate std.bus to std.node
RodrigoDornelles Oct 25, 2024
d20b0fa
feat: std.node.kill and refact launcher example
RodrigoDornelles Oct 25, 2024
23a3fc4
wip: offset of offset
RodrigoDornelles Oct 25, 2024
4263bcd
wip: start std.ui.grid
RodrigoDornelles Oct 28, 2024
986e907
wip: grid system auto ajust sizes and positions
RodrigoDornelles Oct 28, 2024
217d216
wip: support items diferents sizes of cols
RodrigoDornelles Oct 28, 2024
2c4544e
feat: grid resize and docs
RodrigoDornelles Oct 30, 2024
642f06c
wip: support to grid system to ginga
RodrigoDornelles Oct 30, 2024
5cdcf74
feat: add cli command fs-luaconf
RodrigoDornelles Oct 30, 2024
029c59c
feat: support ui to native module
RodrigoDornelles Oct 30, 2024
3979cca
feat: native change title on start
RodrigoDornelles Oct 30, 2024
7921fb3
fix: some things in js
RodrigoDornelles Oct 30, 2024
689441d
ci: version local rename
RodrigoDornelles Oct 31, 2024
272254e
style: fixes in linting
RodrigoDornelles Oct 31, 2024
383f215
fix: passing in tests
RodrigoDornelles Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
luaVersion: '5.4'
-
run: |
lua tools/versionchecker.lua
lua tools/ci_version_local.lua
lint:
if: github.event_name == 'push' || github.event.pull_request.draft == false
Expand All @@ -74,8 +74,7 @@ jobs:
unzip luau-ubuntu.zip
-
run: |
./cli.sh build --bundler --core ${{ matrix.core }}
./cli.sh fs-replace dist/main.lua dist/main.lua --format "function native_callback" --replace "local function _native_callback"
lua tools/ci_luau-analyze.lua ${{ matrix.core }}
-
run: |
./luau-analyze dist/main.lua
11 changes: 9 additions & 2 deletions .luaurc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
"lint": { "*": true},
"lintErrors": true,
"globals": [
"arg",
"bit",
"Buffer",
"canvas",
"event",
"io",
"jit",
"jsRequire",
"load",
"loadfile",
"love",
"native_dict_game",
"native_dict_http",
"native_dict_json",
"native_dict_poly",
Expand All @@ -20,8 +27,8 @@
"native_draw_line",
"native_draw_rect",
"native_draw_start",
"native_draw_text_tui",
"native_draw_text",
"native_get_system_lang",
"io"
"native_get_system_lang"
]
}
5 changes: 5 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CALL_GRAPH = NO
HAVE_DOT = NO
EXTRACT_ALL = YES
USE_MATHJAX = YES
COMPACT_LATEX = NO
EXTRACT_STATIC = NO
SHORT_NAMES = YES
INLINE_GROUPED_CLASSES = YES
Expand All @@ -37,6 +38,10 @@ ALIASES += startebnf=@startuml{ebnf}
ALIASES += endebnf=@enduml
ALIASES += startsalt=@startuml{salt}
ALIASES += endsalt=@enduml
ALIASES += startmindmap=@startuml{mindmap}
ALIASES += endmindmap=@enduml
ALIASES += startmath=@f(
ALIASES += endmath=@f)
# Theme: https://jothepro.github.io/doxygen-awesome-css/
GENERATE_TREEVIEW = YES
DISABLE_INDEX = NO
Expand Down
14 changes: 12 additions & 2 deletions cli.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions docs/build_homebrew_nds.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@defgroup build
@{

@defgroup homebrew
@{

@page build_nds Nintendo DS

You can make your games in Lua for Nintendo DS using Gly Engine.

- **comming soon**

@}
@}
2 changes: 1 addition & 1 deletion docs/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ now you need use npx to run inside your project!
npx gly-cli version
```

---
@htmlonly <hr/> @endhtmlonly

@anchor cli_download

Expand Down
43 changes: 21 additions & 22 deletions examples/asteroids/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ local function asteroid_nest(std, game, x, y, id)
if index ~= id and game.asteroid_size[index] ~= -1 then
local size = game.asteroid_size[index] / 2
local distance = std.math.dis(x, y, game.asteroid_pos_x[index] + size, game.asteroid_pos_y[index] + size)
if (distance - 3) <= size then
if distance <= size then
return true
end
end
Expand Down Expand Up @@ -221,12 +221,12 @@ end
local function loop(std, game)
if game.state == 1 then
local keyh = std.key.axis.x + std.key.axis.a
if std.key.axis.y ~= 0 and game.milis > game.menu_time + 250 then
if std.key.axis.y ~= 0 and std.milis > game.menu_time + 250 then
game.menu = std.math.clamp(game.menu + std.key.axis.y, game.player_pos_x == (game.width/2) and 2 or 1, 9)
game.menu_time = game.milis
game.menu_time = std.milis
end
if keyh ~= 0 and game.milis > game.menu_time + 100 then
game.menu_time = game.milis
if keyh ~= 0 and std.milis > game.menu_time + 100 then
game.menu_time = std.milis
if game.menu == 1 then
game.state = 4
elseif game.menu == 2 then
Expand All @@ -252,7 +252,7 @@ local function loop(std, game)
end
return
elseif game.state == 2 and std.key.press.d then
game.menu_time = game.milis
game.menu_time = std.milis
game.state = 1
return
end
Expand All @@ -262,8 +262,8 @@ local function loop(std, game)
end
-- player move
game.player_angle = std.math.cycle(game.player_angle + (std.key.axis.x * 0.1), std.math.pi * 2) * std.math.pi * 2
game.player_pos_x = game.player_pos_x + (game.player_spd_x/16 * game.dt)
game.player_pos_y = game.player_pos_y + (game.player_spd_y/16 * game.dt)
game.player_pos_x = game.player_pos_x + (game.player_spd_x/16 * std.delta)
game.player_pos_y = game.player_pos_y + (game.player_spd_y/16 * std.delta)
if not std.key.press.up and (std.math.abs(game.player_spd_x) + std.math.abs(game.player_spd_y)) < 0.45 then
game.player_spd_x = 0
game.player_spd_y = 0
Expand All @@ -289,8 +289,8 @@ local function loop(std, game)
game.player_pos_x = 3
end
-- player teleport
if std.key.press.down and game.milis > game.player_last_teleport + 1000 then
game.player_last_teleport = game.milis
if std.key.press.down and std.milis > game.player_last_teleport + 1000 then
game.player_last_teleport = std.milis
game.laser_pos_x1 = game.player_pos_x
game.laser_pos_y1 = game.player_pos_y
game.player_spd_x = 0
Expand All @@ -312,7 +312,7 @@ local function loop(std, game)
game.laser_pos_y2 = game.player_pos_y + (game.laser_distance_fire * cos)
game.laser_pos_x1 = game.player_pos_x + (12 * sin)
game.laser_pos_y1 = game.player_pos_y + (12 * cos)
game.laser_last_fire = game.milis
game.laser_last_fire = std.milis
game.laser_enabled = true
while index <= asteroids do
if game.asteroid_size[index] ~= -1 then
Expand All @@ -330,12 +330,12 @@ local function loop(std, game)
index = index + 1
end
end
if game.laser_enabled and game.milis > game.laser_last_fire + game.laser_time_recharge then
if game.laser_enabled and std.milis > game.laser_last_fire + game.laser_time_recharge then
game.laser_enabled = false
end
-- player death
if game.imortal ~= 1 and game.state == 4 and asteroid_nest(std, game, game.player_pos_x, game.player_pos_y, -1) then
game.menu_time = game.milis
game.menu_time = std.milis
game.lifes = game.lifes - 1
game.state = 5
end
Expand Down Expand Up @@ -364,16 +364,16 @@ local function loop(std, game)
end
-- next level
if game.state == 4 and game.asteroids_count == 0 then
game.menu_time = game.milis
game.menu_time = std.milis
game.state = 6
end
if game.state == 6 and game.milis > game.menu_time + 3000 then
if game.state == 6 and std.milis > game.menu_time + 3000 then
std.game.reset()
game.level = game.level + 1
game.state = 4
end
-- restart
if game.state == 5 and game.milis > game.menu_time + 3000 then
if game.state == 5 and std.milis > game.menu_time + 3000 then
std.game.reset()
game.state = 4
if game.lifes == 0 then
Expand All @@ -385,7 +385,7 @@ local function loop(std, game)
end

local function draw(std, game)
local death_anim = game.state == 5 and game.milis < game.menu_time + 50
local death_anim = game.state == 5 and std.milis < game.menu_time + 50
std.draw.clear(death_anim and std.color.white or std.color.black)
local s = 0
if game.state == 1 then
Expand Down Expand Up @@ -424,7 +424,7 @@ local function draw(std, game)
elseif game.state == 2 then
local height = game.height/4
local w = std.draw.text('Rodrigo Dornelles')
local anim = std.math.cos(std.math.cycle(game.milis, 200) * std.math.pi*2)
local anim = std.math.cos(std.math.cycle(std.milis, 200) * std.math.pi*2)
draw_logo(std, game, height, anim)
std.draw.font('sans', 16)
std.draw.color(std.color.white)
Expand All @@ -436,10 +436,9 @@ local function draw(std, game)
local index = 1
while index <= #game.asteroid_size do
if game.asteroid_size[index] ~= -1 then
local s = game.asteroid_size[index]/2
if game.graphics_fastest == 1 then
local s = game.asteroid_size[index]
std.draw.rect(1, game.asteroid_pos_x[index] - s/2, game.asteroid_pos_y[index] - s/2, s, s)
std.draw.rect(1, game.asteroid_pos_x[index], game.asteroid_pos_y[index], s, s)
elseif game.asteroid_size[index] == game.asteroid_large_size then
std.draw.poly(1, game.asteroid_large, game.asteroid_pos_x[index], game.asteroid_pos_y[index])
elseif game.asteroid_size[index] == game.asteroid_mid_size then
Expand All @@ -458,7 +457,7 @@ local function draw(std, game)
std.draw.color(std.color.yellow)
std.draw.poly(2, game.spaceship, game.player_pos_x, game.player_pos_y, 3, game.player_angle)
-- laser bean
if game.laser_enabled and game.milis < game.laser_last_fire + game.laser_time_fire then
if game.laser_enabled and std.milis < game.laser_last_fire + game.laser_time_fire then
std.draw.color(std.color.green)
std.draw.line(game.laser_pos_x1, game.laser_pos_y1, game.laser_pos_x2, game.laser_pos_y2)
end
Expand All @@ -473,7 +472,7 @@ local function draw(std, game)
std.draw.rect(1, x, y, s, s)
end
-- teleport
if game.milis < game.player_last_teleport + 100 then
if std.milis < game.player_last_teleport + 100 then
std.draw.line(game.laser_pos_x1, game.laser_pos_y1, game.player_pos_x, game.player_pos_y)
end
end
Expand Down
Loading
Loading