robsoft [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=30595 difference between init() and 'code at the top' <p>Sorry if this is really dumb - I don't think I've seen this mentioned anywhere but happy to be corrected!</p> <p>In our games so far, I've used init() to set up 'global' variables and do the one-time-only kind of stuff. But I've seen other code snippets where the same kind of initialisation stuff is done simply by having lines of code at the 'top' of the code area.</p> <p>Is there a difference? I read that init() only gets called once - if it exists, does init() get called <strong>before</strong> any 'code at the top'? What is the order of this stuff? Is there a reason to use one approach over another (other than I personally think code 'at the top' looks untidy, I prefer all the init type stuff to be at the end of the file out of the way).</p> <p><em>Obviously I could sit and play with this and 'black box' it all out, but I think that not knowing this seemingly fundamental point might indicate a basic misunderstanding of the system on my part</em> :-D</p> <p>If there's a good resource for this 'fundamentals' stuff, happy to get a pointer; my go-to at the moment is mostly the manual and the api cheat sheet.</p> https://www.lexaloffle.com/bbs/?tid=32115 https://www.lexaloffle.com/bbs/?tid=32115 Wed, 24 Oct 2018 05:38:39 UTC hitting the compressed size limit <p>Hi, sorry if this has been done to death, I've looked at some of the discussions where it's cropped up, just not clear what the implications are...</p> <p>if our shiny new cart is over the compressed size limit, we can't distribute it as a .PNG, ok I get that. </p> <p>Does that really hamper us much? we can still put it on Windows, Mac and as a file for Pico-8 owners to load and run. Can we still host it in a browser?</p> <p>I've been through and cut down some of my comments (sob), variable names etc will be next but given that we're talking compressed size, I imagine there's not a lot to be really gained doing that, as most stuff will be compressed/tokenised anyway.</p> <p>On the subject of tokens - we're using about half the characters space and we have lots of tokens left. Should I just be less bloody wordy with my code? :-)</p> https://www.lexaloffle.com/bbs/?tid=31835 https://www.lexaloffle.com/bbs/?tid=31835 Thu, 06 Sep 2018 16:19:04 UTC first time out, 'Tanks' <p>Inspired by watching tutorials from Bridgs, MBoffin and Gruber. Scenery collision is a bit hit and miss (lol), but I'm scratching an itch with it right now. This one is 2-player only, sorry - but my goal is a bigger map and a decent single-player mode. Oh, and the next production will have a little more polish to it (including a proper 'death' animation ha ha).... and I'll learn about writing 'optimal' Lua code</p> <p><strong>Objective</strong><br /> Player 1 and Player 2 get to drive around one of 4 maps, blasting each other. Shots can ricochet off the mountains but will travel over water. The harder difficulty adjusts the rate of reload and your speed in relation to shots.</p> <p>Cheers<br /> Robsoft</p> <p> <table><tr><td> <a href="/bbs/?pid=55150#p"> <img src="/bbs/thumbs/pico55149.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=55150#p"> Tanks</a><br><br> by <a href="/bbs/?uid=30595"> robsoft</a> <br><br><br> <a href="/bbs/?pid=55150#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=31675 https://www.lexaloffle.com/bbs/?tid=31675 Tue, 14 Aug 2018 15:58:10 UTC