Table test. Help my lua.

woodnut2 - Custom level - from Android
PlayEdit6 players liked this.Log in to like this level.

I need help with the order things are written for lua.
I wrote my table,
then draw a sprite command.
The tint (red) is wrote next,
then blending code.
Next draw a line,
and a different tint,(blue).
The pixel are blue, and line red. Why?
Help with some draw order rules please :)

Views: 428 Downloads: 97 Unique objects: 2 Total objects: 2

Derivatives

Discuss this level

Log in to comment on this level.
  • Golden: @woodnut: np
  • woodnut2: Not to complicated one step at a time. Much appreciated again. :) @Golden:
  • Golden: @woodnut: lua is bit complicated, it doesn't run many function randomly, it's starts top to bottom, so draw is last, so like blending, tint, filtering, variables, etc. Draw will always be last for all draw function to work, it's like it won't work in first, there's the proof

    function step(count)
    game:message(var)
    var="Test"
    end

    Lua wouldn't understand or run message because there is no given data or variable, because it was run after message, so error should display ;)

    I know this sounds complicated lol
  • woodnut2: @Golden: Thanks, makes sense now. Do all the description then tell to draw. Any order to code blending , tint, layer (z) ?
  • Golden: It's because you have to do tint, blending, or any sprite modification, after all of that must be draw sprite or line
  • hosj12: Wow

LEVEL ID: 24239