It looks like you're new here. If you want to get involved, click one of these buttons!
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!
Comments
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.
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
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
Sure but I would create a class for the player
Them you can add things to the class that describe it
Classes just confuse me, especially the space war tutorial. I'll try it with classes if I can get the hang of how to use them properly
Triangles aren't an option. I think you need to create it with lines.
And yeah the Atari greatest hits won't let me have asteroids saying I have "insufficient credit"
Sorry. If I could send you the rom I would. Maybe when I purchased the activision games I got it too...
Here is how the example did the triangle:
Hope I don't get a 2.99 invoice for it...
I'm buying a $15 card soon and I'm getting activision anthology and the majority of atari's greatest hits. Also now how is that triangle 60 high and 40 wide if I'm seeing 30 and a -20?
I can't get those line segments you posted to draw in codea -_-
I took them from "bit invader" sample.
Anthology is what I purchased. ,wish it was the c64 versions.
I'll try to draw some lines for a ship and see what I get.
Classes are the way to go.
Alright, and I'm going to try and look into using maybe the ship mesh from space war on here if I can't get a line version. I'm trying to do a BASIC version and a Lua version since the languages are similar; also thanks for offering help!
Try
Translate sees to change your "starting point" and then the lines draw.
What basic app are you using? IvBasic or Basic!
Never heard of Ivbasic..I'm using misoft BASIC!, love it a lot
Nice ship, I shrunk it by half values to get a better size, I'm thinking of maybe using x and y= touch.x and y to drag the ship around as virtual buttons and tilt are a bit iffy
I have basic! Too. I like Codea more but it is nice.
If you use basic!, you should post some on the forums for it
. I'm working on simple animations in basic! Just for the heck of it, I thought basic! Was easier, but Codea grows quickly in me...especially since its CPU calc is faster than basic! And don't slow down as much
Basic! Is nice but lua is more modern..
Indeed, I'm going to read and re read the physics lab to make some asteroid polygons, I'm also playing on my Atari 2600 for asteroids! I'll post more as I accomplish things
I'd be glad to give you any advise you I can, but I am no expert with codea or lua.
I played with rotate some. Might need to see how it affects multiple objects.
Before you rotate your ship, you push matrix and then when done, popmatrix. This is how you keep everything from rotating I think....
.@D4rk_Code - Asteroids is a good beginner project. I would suggest you use meshes for the graphics.
I will be extending my SpaceWar! game tutorial with physics at some stage so the ships are attracted toward the sun in the centre of the screen.
In the meantime, if you want to look at another Asteroids version check out @juaxix's version at: http://twolivesleft.com/Codea/Talk/discussion/114/asteroides-source-code#Item_21
I tried this version, and to be honest I don't like it; controls horrendously for me..now the Spacewar! game, I like the tutorials so far, though they have all confused me to death, I believe I might use your triangle ship mesh for the ships if I can't get the one that wrmichael drew me to animate, in the mean time I'm also working on an Enduro port for the Casio Prizm
With permission of course hahha!
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.
Oh well I have a minimal level of understanding, but I guess I don't fully understand how what you're doing works
Also, I"m super bogged down at college so Developing this asteroids will be slowish, help is welcomed, and hopefully a link with the code will be available soon (week or 2)
I have been playing. I have a ship, two buttons. No throttle or firing yet.. Just spinning
Thanks! The button class is telling me it expects a table and gets a nil value so it's broke, I'll keep the asteroids one! I'm looking into physics today, as I got a day off school
does the button class give you a line the error is on? it should work.. I can rotate left and right in my little app.
I have each class in its own code window. I merged them together for simplicity of cut and paste.
Hello World!
error: error: [string "Button = class()..."]:277: bad argument #1 to 'pairs' (table expected, got nil)
Pausing playback
At -- main is where the main program is. Maybe but the button class into its own code window?