lorcav [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=12746 A never-ending, constantly changing network <p> <table><tr><td> <a href="/bbs/?pid=58960#p"> <img src="/bbs/thumbs/pico58959.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=58960#p"> A never-ending, constantly changing network 1.0</a><br><br> by <a href="/bbs/?uid=12746"> lorcav</a> <br><br><br> <a href="/bbs/?pid=58960#p"> [Click to Play]</a> </td></tr></table> </p> <p>Just a little test to draw a set of tesselating sprites in the sprite sheet and then randomly generate a constantly changing landscape.</p> https://www.lexaloffle.com/bbs/?tid=32228 https://www.lexaloffle.com/bbs/?tid=32228 Mon, 12 Nov 2018 11:49:24 UTC Basic LEvel ID I/O <p> <table><tr><td> <a href="/bbs/?pid=20861#p"> <img src="/bbs/thumbs/pico20859.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=20861#p"> Basic LEvel ID I/O 0.1</a><br><br> by <a href="/bbs/?uid=12746"> lorcav</a> <br><br><br> <a href="/bbs/?pid=20861#p"> [Click to Play]</a> </td></tr></table> </p> <p>I've been working on a tile based puzzle game recently and to make things easy initially I setup random generating levels. While this helped me get through adding and testing the mechanics and my code I realised that some times in testing I'd get a level I might want to play again but as it was one of eight million I wasn't likely to generate it again.</p> <p>So I realised that I would need to create Level IDs and a system for inputting them. This is my first attempt at a very basic input and the screen displays the output too that I would feed into some variables in my game to get back to that challenging level. </p> <p>As a complete novice any feedback or improvements are greatly appreciated. My known bugs so far are not knowing a slick method to stop the highlight moving off either end of the row and not being able to limit the range of letters (you can go down from A etc.)</p> <div> <div class=scrollable_with_touch style="width:100%; 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> --basic levelid i/o --by lorcav function _init() cls() hlight={} hlight.x=32 hlspr=29 l1=1 l2=1 l3=1 l4=1 l5=1 l6=1 l7=1 actsprpos=1 end function _update() cls() map (0,0,0,0,16,8) move(hlight) spr(hlspr,hlight.x,40) spr(30,hlight.x,24) spr(l1,32,32) spr(l2,40,32) spr(l3,48,32) spr(l4,56,32) spr(l5,64,32) spr(l6,72,32) spr(l7,80,32) movebound() end function move() if(btnp(0)) --left then hlight.x-=8 actsprpos-=1 end if(btnp(1))--right then hlight.x+=8 actsprpos+=1 end if(btnp(2))--up then entryup() end if(btnp(3))--down then entrydown() end if(btnp(4))--confirm then end end function entryup() if actsprpos==1 then l1+=1 end if actsprpos==2 then l2+=1 end if actsprpos==3 then l3+=1 end if actsprpos==4 then l4+=1 end if actsprpos==5 then l5+=1 end if actsprpos==6 then l6+=1 end if actsprpos==7 then l7+=1 end end function entrydown() if actsprpos==1 then l1-=1 end if actsprpos==2 then l2-=1 end if actsprpos==3 then l3-=1 end if actsprpos==4 then l4-=1 end if actsprpos==5 then l5-=1 end if actsprpos==6 then l6-=1 end if actsprpos==7 then l7-=1 end end function movebound() if hlight.x&gt;=81 then hlight.x=32 actsprpos=1 end if hlight.x&lt;=31 then hlight.x=80 actsprpos=7 end if l1&gt;=14 then l1=1 end end function _draw() print (&quot;please enter level id&quot;,19,44,10) print (l1,35,52,8) print (l2,43,52,8) print (l3,51,52,8) print (l4,59,52,8) print (l5,67,52,8) print (l6,75,52,8) print (l7,83,52,8) end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=3394 https://www.lexaloffle.com/bbs/?tid=3394 Thu, 19 May 2016 15:04:01 UTC Trail of Sprites <p>I'm working up the basics for a small tile puzzle game where players navigate through a maze filling the path behind them so that they can only move on each tile once. so a trail that will then have some collision so it can't be crossed</p> <p>I'm having trouble working out how to leave a trail of sprites. I have a grid set up, and a player sprite to move as follows:</p> <div> <div class=scrollable_with_touch style="width:100%; 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 _init() x = 0 y = 64 end function _update() if (btnp(0)) then x=x-8 end if (btnp(1)) then x=x+8 end if (btnp(2)) then y=y-8 end if (btnp(3)) then y=y+8 end end function _draw() rectfill(0,0,127,127,7) spr(1,x,y) end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>I've tried having something in draw but this ended with the designated sprite following the player around and I tried adding something in the update function with the keystrokes but this b0rked it.</p> <p>It seems to be something beyond what I kno so even if someone can point me in the right direction of something to read up on or code to review that would be much appreciated.</p> https://www.lexaloffle.com/bbs/?tid=3288 https://www.lexaloffle.com/bbs/?tid=3288 Thu, 05 May 2016 16:01:33 UTC