How would I make a top-down map like this?

Hi I was wondering how to make a top down map with physics in codea. I would like some of the aspects to be randomly generated too but that’s ok if I can’t. Would making something like this ( be relatively easy and how would I do it? Thanks!

That’s a pretty big question. How much do you know about programming? It’s easier to answer questions like this when you know how much depth you’ll want.

I’m still probably a beginner as you can see with all my questions XD

It’s probably better to start simpler - generally when you begin programming things, you’ll want to think of the simplest game possible, then make something simpler!

It sounds simple to make, but if you take a quick loop at the dungeon roller example (which is similar to what you ask for), you can see a whole lot of code and tabs and other stuff.

I suggest you start making something like pong, as there are lots of tutorials for it for a variety of different languages, and despite it’s simplicity it has all the major elements of a game - winning/losing, a goal, a game loop, and so on.

Regardless of what you choose to do, good luck! You’ve learnt a lot, quickly, judging by your previous posts.

Thanks! I’ll look into doing that! It is probably better I don’t get in over my head

@compactbear. It sounds like you are making a snake-type game. Which I love, being old-school. :smiley:

Start with that and get just the bare bones up and running, even if it’s just directing a snake around an empty background. Then add your features on one-by-one. Just adding one little thing each step, you can learn different things. Saving scores, detecting collisions, shooting, walls to get in the way, tiled backgrounds, etc. Finally, maps and seeking routines. End of the level Bosses! Eventually, you will have the game you want along with some mad programming skillz!

@compactbear Are you after something like this. You would have to create new sprites for your walls and whatever else you want to show. I just used existing sprites for this example.

function setup()
    sprite("Planet Cute:Wall Block")
    table.insert(sp,"Planet Cute:Grass Block")
    table.insert(sp,"Planet Cute:Wall Block")
    table.insert(sp,"Small World:Tree Cone")

function draw()
    for a,b in pairs(map) do
        for c,d in pairs(b) do
            if d~=1 then

I would do a grid-based system like at dave1707 is showing you. Grid-based is nice because it is simple for 2D things and it makes it (IMO) very easy to make a level-editor.

@compactbear I changed the above code to make the map table bigger and have the map match the orientation of the screen. I also added another sprite. You can add different values to the table to show other sprites.

Also, you could look at the Map code for my game 10Life 2 on Codea Community… That one uses custom collisions, though. I’m not sure how you’d use the built-in physics engine on a top-down scene, it was designed for a side view.

@SkyTheCoder linearDamping and no gravityScale = top down 2D physics

Dave thanks! Thats what I was thinking of!