Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Vauteck

#1
Bugs & Feature requests / Movement behaviour
May 15, 2015, 05:17:18 PM
Hello,

Nice tutorial on movements Christopho ! The engine and the new editor are really improving nicely !

I have a remark on the movement implementation applied to a menu in your video tutorial ; in the on_draw function, you always draw the menu logo at fixed coordinates (0, -160), and you then rely on the movement you initialized previously in the on_started function to actually move the logo.

This way of doing feels a bit "unnatural", in the sense that since the on_draw function is called regularly, if you draw something at fixed coordinates, it should always be drawn at these coordinates right ?
Also, it feels kinda weird to not initialize the logo position in the on_started function but in the on_draw function instead.
Maybe something like this would feel more "natural" for coders:


function solarus_logo_menu:on_started()
    image.set_position(0, -160)
   // Initialize the movement here
   ...
end

function solarus_logo_menu:on_draw(dst_surface)
    image:draw(dst_surface, image.get_pos_x(), image.get_pos_y())
    // or just
    image:draw(dst_surface)
end 


Anyway, keep up the good work !

Cheers

Vauteck