I need help on a project (beginner)

I’m re-making atari’s “asteroids” the 2600 version, not the arcade, I like the 2600 more and was playing it yesterday ^^. Anyways, I want to draw the game the way it was ment to look, 8-bit and blocky, no standard pre made sprites if that makes sense. Also I’ve done all the “getting started” tutorials available and they didn’t really help (except for teaching me gravity.x and y and how to make a circle follow me). So far I’m not sure if I’m even close to being right but what I have is:

---------code block----------
Function setup()
Px = Screenwidth/2
Py = screenheight/2 – for the player starting in the center like the original

Ax = math.random
Ay = math.random – asteroid start points

And I’m thinking I’ll need delta.x and delta.y for calculating momentum?
---------end block---------

I can draw the sprites in codes sample creator but I’d rather have the game draw them so it all looks semi-authentic, plus I think the majority of spritey. Modern remakes look tacky and aren’t my thing, sorry if it’s a little vague or annoying but I’m trying to do a bunch of this before next fall before I start classes in Lua and C; plus I feel like porting over many classic games would simply just be fun, any help is appreciated…thanks!

Hi @D4rk_Code - sorry the tutorials are confusing, that is obviously not the intent! I sometimes forget the level of assumed knowledge required.

Is there a particular bit which I need to expand on? If you are having trouble understanding then other people probably are as well.

Start with physics lab… Watch how that code is done.

I am seeing how it is, but how would the physics lab be relavant to a 2600 re make? I shall study it as best I can nonetheless!

I wouldmthink The rules of physics apply to any game regardless of the cheesy graphics.

You could use the shape generator but fill in the shape with a color.

You want to handle collisions?

I believe I have asteroids on my iPad. I’ll review and see what I can think of that might help.

Thanks! And I love those cheesy blocky graphics, shape generator? You mean like draw rect(10,20,20,80)? I guess I could, I’ll have to figure out a good size. And collisions maybe; I’m looking more into if a rock hits me I die, and if the UFO hits anything it blows up and breaks an asteroid, just like the original. :slight_smile:

I checked it out. It has been a long time.

Asteroids can touch each other, but collision with your ship has to be accounted for and your fire.

The Asteroids also loop from top to bottom. Not sure physics lab handles that.

Sounds like a fun challenge to recreate.

So what you want is a random asteroid generator to start…

Maybe you can creat a sprite to start and convert to code, then see how you can randomize the jagged edges and size?

Well I didn’t know they looped, I thought it used a math.random (x,y) to spawn them, then just re drew them as they left the screen. But I suppose as long as I use predictable paths the loops will be the easiest part of all of this. The ship I’ll need to figure out how to make the right size, and I’m thinking I’ll make the UFO spawn random top right, or somewhere left of screen and follow the player by telling it ux(UFO x)=px(player x)+1 until ux=px…that’s how it works in BASIC anyhow

My first astreoid:

Sprint to image from sprite editor

local img = image(8, 8)
img:set(1,4,0,255,0,255)
img:set(1,5,0,255,0,255)
img:set(1,6,0,255,0,255)
img:set(2,1,0,255,0,255)
img:set(2,2,0,255,0,255)
img:set(2,3,0,255,0,255)
img:set(2,4,0,255,0,255)
img:set(2,5,0,255,0,255)
img:set(2,6,0,255,0,255)
img:set(2,7,0,255,0,255)
img:set(3,1,0,255,0,255)
img:set(3,2,0,255,0,255)
img:set(3,3,0,255,0,255)
img:set(3,4,0,255,0,255)
img:set(3,5,0,255,0,255)
img:set(3,6,0,255,0,255)
img:set(3,7,0,255,0,255)
img:set(4,1,0,255,0,255)
img:set(4,2,0,255,0,255)
img:set(4,3,0,255,0,255)
img:set(4,4,0,255,0,255)
img:set(4,5,0,255,0,255)
img:set(4,6,0,255,0,255)
img:set(4,7,0,255,0,255)
img:set(5,1,0,255,0,255)
img:set(5,2,0,255,0,255)
img:set(5,3,0,255,0,255)
img:set(5,4,0,255,0,255)
img:set(5,5,0,255,0,255)
img:set(5,6,0,255,0,255)
img:set(5,7,0,255,0,255)
img:set(6,2,0,255,0,255)
img:set(6,3,0,255,0,255)
img:set(6,4,0,255,0,255)
img:set(6,5,0,255,0,255)
img:set(6,6,0,255,0,255)
img:set(6,7,0,255,0,255)
img:set(7,3,0,255,0,255)
img:set(7,4,0,255,0,255)
img:set(7,5,0,255,0,255)
img:set(7,6,0,255,0,255)
return img

And yes, a random asteroid generator, thanks for this idea! And yeah converting sprite to code sounds logical, or heck worst case I’ll use sprites

Go get the Atari app, the games are free right now.

Goodness however did you come up with that?

Which app? And what games???

“atari’s greatest hits”

The main app has arcade style. But on the bottom, one option gives you Atari 2600 games.

It’s not free for any but missile command

I also got pitfall 2 from an activision app, but that was 2.99

I just downloaded asteroids for free. Are you sure your at the 2600 games?

On the bottom, click the Atari joystick.

I’m re-installing on my iPad right now so I’ll find out in about 10 mins(my Internet sucks) but tell me if this make sense in code for player setup

Function setup()
Px = width/2
Py = height/2 --starts in center

Function draw()
TRIANGLE(25,25,30) --small triangle just like the 2600