Hi, I am trying to simulate a football game with Makie. Thereby the score and the time are updated in each step of the animstep!() function. I do not get an error message, but neither the time nor the result is updated.
using GLMakie
using Makie
using FileIO
using CairoMakie
t = Observable("0:00")
goals_x = Observable(0)
goals_y = Observable(0)
times = game_time() #array with strings from "0:00" to "90:00"
fig = Figure(resolution=(600, 600),backgroundcolor = "skyblue")
axes = Axis(fig[1,0], aspect = DataAspect(), yreversed = false, title = "Ecuador")
hidedecorations!(axes)
hidespines!(axes)
tightlimits!.(axes)
axes1 = Axis(fig[1,3], aspect = DataAspect(), yreversed = false, title = "Qatar")
hidedecorations!(axes1)
hidespines!(axes1)
tightlimits!.(axes1)
text = @lift("$($t)")
result = @lift("$($goals_x):$(($goals_y))")
image!(axes, img)
image!(axes1, img1)
Label(fig[1, :], result, textsize = 50)
Label(fig[0, :], text, textsize = 20)
display(fig)
for i in 1:(90*60 + 1)
animstep!("A1","A2",teams,i,t,goals_x,goals_y,times)
#sleep(0.001)
end
The animstep!() is defined as follows:
function animstep!(x,y,teams,i,t,goals_x,goals_y,times)
t[] = times[i]
goals_x[] += game_step("A1","A2",teams,i)[1]
goals_y[] += game_step("A1","A2",teams,i)[2]
end
About a tip or any form of help I would be very grateful