Sunday, September 12, 2010

Why COF is so great

This is most of the instructions for the game drawing a cyan enemy, as it stands right now:


dir=direction

x+=lengthdir_x(1,dir+180)
y+=lengthdir_y(1,dir+180)


temp=lengthdir_x(2.4,dir-22)
temp2=lengthdir_y(2.4,dir-22)
temp3=lengthdir_x(2.4,dir+22)
temp4=lengthdir_y(2.4,dir+22)



tx[0]=x+temp*6
ty[0]=y+temp2*6
tx[1]=x+temp3*6
ty[1]=y+temp4*6
tx[2]=x+lengthdir_x(10.8,dir-90)+lengthdir_x(6.48,dir)
ty[2]=y+lengthdir_y(10.8,dir-90)+lengthdir_y(6.48,dir)
tx[3]=x+lengthdir_x(10.8,dir+90)+lengthdir_x(6.48,dir)
ty[3]=y+lengthdir_y(10.8,dir+90)+lengthdir_y(6.48,dir)
tx[4]=x-temp3*5
ty[4]=y-temp4*5
tx[5]=x-temp*5
ty[5]=y-temp2*5

tx[6]=x+temp*10
ty[6]=y+temp2*10
tx[7]=tx[6]+lengthdir_x(4.8,dir+90)
ty[7]=ty[6]+lengthdir_y(4.8,dir+90)
tx[8]=x+temp3*10
ty[8]=y+temp4*10
tx[9]=tx[8]+lengthdir_x(4.8,dir-90)
ty[9]=ty[8]+lengthdir_y(4.8,dir-90)

tx[10]=x+lengthdir_x(13.44,dir+133)
ty[10]=y+lengthdir_y(13.44,dir+133)
tx[11]=x+lengthdir_x(13.44,dir-133)
ty[11]=y+lengthdir_y(13.44,dir-133)
tx[12]=tx[10]+lengthdir_x(12.24,dir)
ty[12]=ty[10]+lengthdir_y(12.24,dir)
tx[13]=tx[10]+lengthdir_x(4.8,dir-90)
ty[13]=ty[10]+lengthdir_y(4.8,dir-90)
tx[14]=tx[11]+lengthdir_x(12.24,dir)
ty[14]=ty[11]+lengthdir_y(12.24,dir)
tx[15]=tx[11]+lengthdir_x(4.8,dir+90)
ty[15]=ty[11]+lengthdir_y(4.8,dir+90)

draw_line(tx[6],ty[6],tx[7],ty[7])
draw_line(tx[8],ty[8],tx[9],ty[9])
draw_line(tx[0],ty[0],tx[1],ty[1])
draw_line(tx[0],ty[0],tx[6],ty[6])
draw_line(tx[1],ty[1],tx[8],ty[8])
draw_line(tx[0],ty[0],tx[2],ty[2])
draw_line(tx[1],ty[1],tx[3],ty[3])
draw_line(tx[2],ty[2],tx[4],ty[4])
draw_line(tx[3],ty[3],tx[5],ty[5])
draw_line(tx[4],ty[4],tx[5],ty[5])

draw_line(tx[10],ty[10],tx[12],ty[12])
draw_line(tx[10],ty[10],tx[13],ty[13])
draw_line(tx[11],ty[11],tx[14],ty[14])
draw_line(tx[11],ty[11],tx[15],ty[15])

draw_set_alpha(alph/1.2)
draw_triangle(tx[0],ty[0],tx[1],ty[1],tx[2],ty[2],0)
draw_triangle(tx[3],ty[3],tx[1],ty[1],tx[2],ty[2],0)
draw_triangle(tx[2],ty[2],tx[3],ty[3],tx[4],ty[4],0)
draw_triangle(tx[5],ty[5],tx[3],ty[3],tx[4],ty[4],0)
draw_triangle(tx[10],ty[10],tx[12],ty[12],tx[13],ty[13],0)
draw_triangle(tx[11],ty[11],tx[14],ty[14],tx[15],ty[15],0)

x-=lengthdir_x(1,dir+180)
y-=lengthdir_y(1,dir+180)




And that was a pain because I had to figure out all the angles and everything. Now I have a much nicer, general algorithm that I'm not going to post for various reasons, and I just have to tell an object what model file to use and it will draw it.
For some of the enemies, I used values calculated based on other values in order to determine coordinates of vertices, which is hard to translate directly into a COF-readable file. My options are to make a piece of code for each enemy that outputs coordinates, or to just remake the models using COF. I've chosen to do the latter (because dang it's fast and effective), but I'll keep the crazy instructions I made for each one (like you see above), for posterity's sake.

Wednesday, May 5, 2010

ColourFire is changing hosts

http://colourfire.nfshost.com appears to be the new host, since nerium.org appears to be going down in a few days and not returning. A sad thing, but SCIENCE must continue! So expect an update soon. I can't promise more than making it continue to work, but that's better than if it stopped working and I didn't update it!

Thursday, February 11, 2010

A new challenger approaches!

Not actually a challenger. Gat (a good friend of mine own self) has a blog at http://pletcy.blogspot.com/ which you should look at. So far it's entertaining, and he's only 1 post in! Now that's talent.

Also, ColourFire will in future use the latest IDE version, so the load times will be faster and the runtimes will be slightly less slow but we'll have to work out a bunch of glitches! YAAAAAAAAAAYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

Wednesday, February 3, 2010

Elizabeth Maxwell=awesome

Or I could be nerdy and say
if (Elizabeth_Maxwell==awesome){
blog_post();}
but I'm not go-... oh, too late. Well.

Anyway, here's her blog.
So! In celebration of her coolness, I got her a platinum upgrade for her Something Awful Forums account for x-mas. In return, she offered to draw me anything I wanted! Whoah!
I took a while to figure out what to ask for (sorry :<) but long story short here's the image:
Sweet! Baltarstar Galactica meets Team Fortress 2. :D

Friday, January 15, 2010

CF version .9h is out. Also, I'm going to rant now.

Ranting is what people do in weblogs, right? Time I had a proper one. Or something.

I find rude people funny. Not just people who are kind of jerks, but full-on scumbag types. The kind whose redeeming values just aren't enough to offset their overbearing wretchedness. Now, I don't like to be around them for very long. I prefer the company of people who are at least reasonably polite toward me. Every once in a while, however, I like to see someone who is outright nasty, for no good reason. It's such a great contrast! I don't mean like, "they make everyone else look better." That would be kind of pretentious. It's more like "haha, how did that get there?" Condescension optional, depending on the desired irony of this reading.
Anyway, I've only met a few people like that. They were awfully refreshing. Humans are so funny.