ScratchData LogoScratchData
Back to gtoal's profile

zoomable 2d scroller for Puwexil (PoC demo)

GTgtoal•Created August 7, 2017
zoomable 2d scroller for Puwexil (PoC demo)
40
25
804 views
View on Scratch

Instructions

NEW: zoom in and out with W and Q keys! (see https://scratch.mit.edu/discuss/topic/272731/ ) Scroll the map around using the arrow keys. See inside for the object location API. (THIS IS NOT COMPLETE: I don't yet position objects on the zoomed map correctly and it jumps more than you expect if you zoom after scrolling much...(because it is zooming based on a center of 0,0 rather than the actual center of what is currently displayed) This was just a quick proof of concept... It works OK if you just zoom first then scroll...)

Description

Map generator uses components from @LocoMule and @DadOfMrLog. This is a trivial implementation of a 2D data structure. It is implemented using a linear list, which will be quite slow if there are a large number of objects. Can you make it significantly faster? Perhaps by using quad trees? btw this scrolling demo uses an adaptive speed algorithm to make the scrolling look faster than it really is :-) (Once it speeds up, it jumps by whole tiles rather than pixel positioning) The objects are all different costumes of a single sprite.

Project Details

Project ID170693620
CreatedAugust 7, 2017
Last ModifiedAugust 10, 2017
SharedAugust 7, 2017
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root