Log In  

Daytime; Swift, C#, Delphi, Xamarin.
Nighttime; Pico-8, C64, Spectrum, Amiga.

:: Unfold ::

Sorry if this is really dumb - I don't think I've seen this mentioned anywhere but happy to be corrected!

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.

Is there a difference? I read that init() only gets called once - if it exists, does init() get called before 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).

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 :-D

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#58323 2018-10-24 05:38 ( Edited 2018-10-24 09:38)

:: Unfold ::

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...

if our shiny new cart is over the compressed size limit, we can't distribute it as a .PNG, ok I get that.

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?

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.

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#56309 2018-09-06 16:19 ( Edited 2018-09-06 21:21)

:: Unfold ::

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

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.


Cart #55149 | 2018-08-14 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#55150 2018-08-14 15:58 ( Edited 2018-08-15 14:46)

Follow Lexaloffle:          
Generated 2023-12-10 07:53:44 | 0.060s | Q:10