I've written a quick and dirty implementation of a 3x3 sliding puzzle that can be played on the map or in client.screen.
Playing it on the map automatically adds "slide animations" between the movements because its only 0 to 1 on the x or y value (byond does this automatically).
In client.screen, we're simply setting the screen_loc values and there are no gliding transitions between the movements.
I am wondering how I could achieve this same effect but in client.screen?
ID:1098278
![]() Dec 25 2012, 6:25 pm
|
|
![]() Dec 25 2012, 9:03 pm
|
|
Assume pseudo-code because I don't remember variable names or syntax.
|
This code is really terrible and needs tons of cleaning up, but it works:
proc/MoveSlide(puzzle_slide/slide, detect = 0) screen objects are not individually effected by pixel_x (changing pixel_x of an object that is in client.screen does not move it). You must use the colon in screen_loc (ie: x:offset_x,y:offset_y) |
Zaoshi wrote:
Assume pseudo-code because I don't remember variable names or syntax. > var/step_size = round(world.icon_size / world.tick_lag) I think you meant world.icon_size * world.tick_lag for step_size I decided to just hard-code the step size |