codlark [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=15623 LLE Layered Level Editor <p> <table><tr><td> <a href="/bbs/?pid=39738#p"> <img src="/bbs/thumbs/pico40582.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=39738#p"> LLE Layered Level Editor 1.0</a><br><br> by <a href="/bbs/?uid=15623"> codlark</a> <br><br><br> <a href="/bbs/?pid=39738#p"> [Click to Play]</a> </td></tr></table> </p> <p>LLE is a level editor that supports multiple layers, with each layer stored on cart as different sections of the map. LLE works by loading the sprite and map data of a user's cart, making changes, and saving back to the cart. Be sure to download LLE for best effect!</p> <p>For demo purposes the cart comes with a small selection of sprites and a level made with them to show off the editor can do, but otherwise to actually use LLE you have to tell it where the layers are and how big the level is; all layers are considered the same size.</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> working_cart = &quot;&quot; --file name (with .p8) of the cart you want to edit lvl_size = {width,height} --in map cells, overall size of the level lvl_layers = { --starting point of each layer of the level on the map {x,y}, --each layer is an x,y pair, like so {x2,y2} } </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The optional function level(), found below the settings, is then copied to your cart and called to draw the level</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> function level(sx,sy, --screen position in pixels to draw the level size,layers, --same as lvl_size and lvl_layers above visible --optional, a table of true or false values indicating which levels to draw, if nil or left off, all layers will be drawn ) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You don't have to use level(), you can use LLE to ensure that a scrolling background matches the rest of the level and use your own parallax-draw function, or use the different layers to make different levels that use the same background layer, or make a huge map and chunk it into layers to edit easier, or make a bunch of small variations of the same level, or whatever you want.</p> <p>LLE works more or less like the built in editors, specifically it can:</p> <p>Save and Load - The active level can be saved and reloaded from the pause menu<br /> Full Screen - The sprite window can be hidden from view<br /> Zoom - The level can be zoomed from 25% to 200% in increments of 25 points<br /> Draw - Left click to place a sprite in a cell, right click to select the sprite under the cursor<br /> Pan - Pan around the map, or use the direction keys<br /> fill - Flood fill an area of the map with the selected sprite<br /> Layer Selector - On the left edge of the middle bar; left click to select a layer to draw on, right click to toggle layer visibility<br /> Sprite Selector - Select a sprite to draw with using a familiar interface<br /> Status Bar - The status bar reports on location of mouse, status of saves, etc.<br /> Undo - <em>new</em> Undo the last made change by pressing Z<br /> Select - <em>new</em> Use the select tool to select a region on the level<br /> Copy - <em>new</em> Press X to copy the selection from the active layer to the clip board<br /> Paste - <em>new</em> Use the stamp tool to paste the contents of the clip board onto the active layer of the level.</p> <p>The next planned features are an autosave feature using a packed string format and sprite sizes other than 1x1; I have a few more ideas, like storing selected tool/sprite/layer to CDATA, but that's what I'm gonna work on next. But I'm always interested in suggestions for more :)</p> <p>change log<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;">v1.0 </p> <ul> <li>added undo and copy/paste functionality</li> <li>redrew tool icons</li> <li>changed demo level</li> </ul> <p>V0.8 - initial release<br /> </div></div></div></p> https://www.lexaloffle.com/bbs/?tid=29187 https://www.lexaloffle.com/bbs/?tid=29187 Mon, 17 Apr 2017 15:31:41 UTC