Skip to content

Commit

Permalink
Added game_include to allow for the inclusion of other files.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbigbrain committed Oct 31, 2020
1 parent 938cc41 commit 0e04381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion example/BasicGame/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function update(g::Game)
dx = 2
end


end

# If the "space" key is pressed, change the displayed image to the "hurt" variant.
Expand Down
7 changes: 5 additions & 2 deletions src/GameZero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Colors
using Random

export Actor, Game, game, draw, schduler, schedule_once, schedule_interval, schedule_unique, unschedule,
collide, angle, distance, play_music, play_sound, line, clear, rungame
collide, angle, distance, play_music, play_sound, line, clear, rungame, game_include
export Keys, MouseButtons, KeyMods
export Line, Rect, Circle

Expand Down Expand Up @@ -74,6 +74,7 @@ end

getifdefined(m, s, v) = isdefined(m, s) ? getfield(m, s) : v


mainloop(g::Ref{Game}) = mainloop(g[])

function mainloop(g::Game)
Expand Down Expand Up @@ -224,7 +225,9 @@ function initgame(jlf::String)
g.screen = initscreen(game_module, "GameZero::"*name)
clear(g.screen)
return g
end
end

game_include(jlf::String) = Base.include(game[].game_module, jlf)


function getfn(m::Module, s::Symbol, maxargs=3)
Expand Down

0 comments on commit 0e04381

Please sign in to comment.