Log In  
Follow
autopawn

Hello, I reported this race condition on itch.io but got no replies so I am posting it again here, in case somebody stumbles on it.

This problem happens when the cart data is in use and the cartridge is quickly restarted.

Consider the following code:

value = 0
frame = 0
function _init()
  cartdata("race_condition")
  value = dget(0)
  dset(0,0) -- set value to 0 for next reload with ctrl+r
end
function _update()
  if btnp(5) then
    dset(0, (value+1)%10) -- increase value by 1
    run() -- reset cartridge
  end
  frame += 1
end
function _draw()
  cls()
  print("current value: "..value, value+1)
  print("frame: "..frame)
end

If you look at it, the expected behavior would be that:

  • If you press X, the stored value should increase by 1 (modulus 10) and then the cartridge should restart and load that value.
  • If you reset with Ctrl+R, no value is set so it should be reset to 0 because of the dset(0, 0) at the end of the init.

[ Continue Reading.. ]

3
3 comments



Cart #murder_drones_virtual_training-3 | 2024-03-25 | Code ▽ | Embed ▽ | No License
20

This is a hard action-platformer fangame based on the Murder Drones indie animated series by GLITCH.

You play as a new disassembly drone that has to complete his training in a virtual environment.

Controls

  • Arrow keys to move.
  • [X] to flutter.
  • [C] to shoot and detonate rockets (when available).
  • [↓] to perform a dive maneuver.
  • [Enter] for additional options.

Credits

  • Autopawn (Discord: autopawn)
  • Remi Mixer (Discord: remimixer)
  • Crjönch (Discord: crjonch, Twitter: @Slimyappraisal)
  • Miszuk (Discord: miszukuwu)

[ Continue Reading.. ]

20
42 comments