Skip to content

Commit

Permalink
standardize makie rendering of objects (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sid-Bhatia-0 authored Oct 8, 2020
1 parent b0a2d74 commit fd05306
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/render_with_Makie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ function init_screen(w::Observable{<:AbstractGridWorld}; resolution=(1000,1000))

# 2. paint each kind of object
for o in get_object(w[])
if o === WALL
poly!(scene, @lift(boxes(findall($w.world[WALL, :, :]), $tile_size)), color=:darkgray,)
elseif o === GOAL
scatter!(scene, @lift(centers(findall($w.world[GOAL,:,:]), $tile_size)), color=get_color(GOAL), marker=convert(Char, GOAL), markersize=@lift(minimum($tile_size)))
elseif o isa Door
scatter!(scene, @lift(centers(findall($w.world[o,:,:]), $tile_size)), color=get_color(o), marker=convert(Char, o), markersize=@lift(minimum($tile_size)))
elseif o isa Key
if o !== EMPTY
scatter!(scene, @lift(centers(findall($w.world[o,:,:]), $tile_size)), color=get_color(o), marker=convert(Char, o), markersize=@lift(minimum($tile_size)))
end
end
Expand Down

0 comments on commit fd05306

Please sign in to comment.