Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411613 Posts in 69390 Topics- by 58447 Members - Latest Member: sinsofsven

May 09, 2024, 05:35:55 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperArt (Moderator: JWK5)Drawing asteroids style art
Pages: [1]
Print
Author Topic: Drawing asteroids style art  (Read 1202 times)
sevn
Level 0
***


Game design student


View Profile WWW
« on: July 18, 2012, 11:39:09 PM »

I'm making a little asteroids style game in C# Xna. Any suggestions for how to do the asteroids? At the moment this is what I'm doing to draw the asteroids.



Theres got to be a better way though. Probably a procedurally generated way too.
Logged

1982
Level 8
***



View Profile
« Reply #1 on: July 19, 2012, 01:22:51 AM »

Original Asteroids had calculated vector graphics, so if you want to really imitate that style you would have to do it like that. Then again, I don't see nothing wrong with your current approach. It is not very difficult or time consuming just to draw white lines on black background. You could write procedural graphic engine too, considering these types of graphics it might not be so difficult.
Logged

TomHunt
Level 3
***



View Profile WWW
« Reply #2 on: July 19, 2012, 02:03:31 AM »

Yeah, pretty much what you're doing, but do it with code.

You can get some pretty decent looking asteroids by drawing lines between points at a random radius from the center from the asteroid at points evenly distributed around the center.

so, roughly:
Code:
float theta_inc=360.0f/num_points;
float theta=0;
for (int i=0; i<num_points; ++i){
   float radius= min_radius + (float)rand()/((float)RAND_MAX/(max_radius-min_radius));
   points[i].x=radius*cos(theta);
   points[i].y=radius*sin(theta);
   theta+=theta_inc;
}
Logged

~tom | □³ | kRYSTLR
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic