Introduction and Request for Advice

Hi everyone,

Just posting my first ‘official’ comment as a new discussion in order to stay on the good side of the forum police! :wink: I’m absolutely loving Codea and am just so impressed with what TLL have created and the functionality they’ve managed to pack into it. It would be amazing at twice the price! That said, my experience of ‘code’ is pretty much limited to some very early dabbles with a ZX81 and a bit of html5/js (so basically none!) and yet I find the whole Lua thing pretty manageable, especially with all the extra libraries that have been thrown in (the tutorials by Ignatz and Reefwing have also been invaluable so thanks guys!)

Anyway, that’s the gushy part over… I’m dipping my toe in the water by trying to program a very simple puzzle game that works by creating a randomly generated (but hidden) path that the player has to discover by tapping the screen. I think. I’ve got the simple things covered but just wanted to get some advice on generating the values of the path.

My first idea was to use a simple square and +1 it around the screen (randomly turning left and right) until it got to a predetermined point. Do you think this is the most efficient way of doing this and, if so, what’s the best way to generate the values of the square? By generating an array that covers the area of each new square? Or using a vector perhaps? To be honest, I don’t know enough about either yet to know which one I should be exploring so a point in the right direction would be really appreciated!

Sorry if this is unclear or a bit long… this stuff absolutely fascinates me! :slight_smile:

@ScottDafydd Welcome to the forum and it’s great that you’re enjoying things. One thing you might try is a search of the forum for maze routines. There should be several. You could probably use one of those to draw your original path.

I would take a look at the ‘Jumper’ Pathfinding Library, See how that works

Welcome @ScottDafydd

Thanks guys. Yes, I thought that might be helpful too and managed to find a really cool maze generator someone had posted but wasn’t sure the best way to use it. The idea was that if the tap was on the correct route/path then it would make a hollow sound and if it wasn’t then it would make a solid sound. At first, I wasn’t sure the best way to utilise a traditional maze generator to enable this but it’s just occurred to me (hello!) that I could just make the walls a bit thicker and the maze parameters a bit simpler and, hey presto… could be just what I’m after. Thanks @Dave1707!

Thanks too @CodeaNoob. Out of interest: do you mean the Lua jump example? Which bit do you think would be most useful?

Oops, sorry @CodeaNoob - just realised that’s probably not what you meant at all!

(Wow, just found what you were referring to. Looks like it might be exactly the thing. That’s two great options I have now. Thanks everyone… this has been really helpful!)

Welcome, I’m a total newbie too but the people here have been incredibly friendly and very helpful. You’re in good hands :slight_smile:

Thanks Tyson!