drChengele
Level 2
if (status = UNDER_ATTACK) launch_nukes();
|
|
« Reply #100 on: September 02, 2011, 02:49:33 PM » |
|
Not really code but a changelog, I think it qualifies. - Split off blueprints from archetypes. Finally blueprints can be targeted by modifiers \o/ - Just remembered I haven't coded in modifiers yet FFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUU
|
|
|
Logged
|
PraetorCurrently working on : tactical battles.
|
|
|
|
Ishi
|
|
« Reply #102 on: September 05, 2011, 03:12:53 PM » |
|
I found a comment at the top of a file that I wrote about a year ago and then forgot about. // cEasyMenu // "It really takes the misery out of making menus"
That was fun to skim through.
|
|
|
Logged
|
|
|
|
|
J. Kyle Pittman
|
|
« Reply #104 on: September 12, 2011, 09:21:42 PM » |
|
DoThisEveryTimeBecauseImDumb.loadBMP("map_tiles.bmp");
|
|
|
Logged
|
|
|
|
ChevyRay
Guest
|
|
« Reply #105 on: September 12, 2011, 10:47:41 PM » |
|
Had this sitting in my code forever before I noticed it, heh. Scene girl = new SceneGirl();
|
|
|
Logged
|
|
|
|
Aynslei
Level 0
|
|
« Reply #106 on: September 23, 2011, 02:45:18 PM » |
|
I wanted a simple way to show the first year kids how to check if a section of code has run once before.......
boolean firstTime = true;
Which would later be turned into.
firstTime = false;
I am so bad.
|
|
|
Logged
|
\"All things are born, and all things die. It is left to us to decide what we make of them.\" - Aynslei
|
|
|
ChevyRay
Guest
|
|
« Reply #107 on: September 23, 2011, 04:44:07 PM » |
|
Haha that is beautiful.
|
|
|
Logged
|
|
|
|
|
eclectocrat
|
|
« Reply #109 on: September 24, 2011, 12:30:21 AM » |
|
|
|
|
Logged
|
|
|
|
ThemsAllTook
|
|
« Reply #110 on: September 25, 2011, 09:05:34 AM » |
|
Not quite code, but closely related: I was having trouble finding the right word for something, so I looked it up in a thesaurus...before I realized how ridiculous it was to do that for something that was going into an svn commit message. Which has a vanishingly small chance of ever being read again.
|
|
|
Logged
|
|
|
|
J-Snake
|
|
« Reply #111 on: September 25, 2011, 09:25:19 AM » |
|
Here's another marvel from my side, including extremely long, nested expressions, magical numbers and the same values calculated more than once, and other stuff. Hey, I just wanted to make sure that it actually worked, before I, possibly, wasted time on making it pretty! Did it work? Yes! Wow, I wish the code of my first game 10 years ago would be that nicely structured. ASM-spaghetti deluxe!
|
|
|
Logged
|
|
|
|
Dan Cardin
|
|
« Reply #112 on: September 26, 2011, 07:53:03 AM » |
|
I only ever laugh at my code when it works the first time i run it.
|
|
|
Logged
|
|
|
|
mokesmoe
|
|
« Reply #113 on: September 26, 2011, 08:43:43 AM » |
|
Not really code, but I managed to upload a build of a game that crashed when you died because I completely forgot to code the death. (I was good at playing it from testing so I never noticed.)
|
|
|
Logged
|
|
|
|
Mikademus
|
|
« Reply #114 on: September 26, 2011, 10:57:07 AM » |
|
static sf::Shape *pERect; Fyi, the 'E' is the typo.
|
|
|
Logged
|
\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
|
|
|
Sakar
Guest
|
|
« Reply #115 on: September 30, 2011, 11:17:38 AM » |
|
void Entity::draw() { glPushMatrix(); glTranslatef(x, y, 0); glRotatef(rot, 0, 0, 1); glScalef(scale, scale, scale);
glColor3ub(color.getRed(), color.getGreen(), color.getBlue()); if(graphic == NULL) glBindTexture(GL_TEXTURE_2D, 0); else glBindTexture(GL_TEXTURE_2D, graphic->getId()); Spritemap* sm = static_cast<Spritemap*>(graphic); glBegin(GL_QUADS); if(typeid(graphic).name() == "Texture*") glTexCoord2i(0, 1); else glTexCoord2f(sm->getFrame().x, sm->getFrame().h); glVertex2i(-width/2, height/2);
if(typeid(graphic).name() == "Texture*") glTexCoord2i(1, 1); else glTexCoord2f(sm->getFrame().w, sm->getFrame().h); glVertex2i( width/2, height/2);
if(typeid(graphic).name() == "Texture*") glTexCoord2i(1, 0); else glTexCoord2f(sm->getFrame().w, sm->getFrame().y); glVertex2i( width/2, -height/2);
if(typeid(graphic).name() == "Texture*") glTexCoord2i(0, 0); else glTexCoord2f(sm->getFrame().x, sm->getFrame().y); glVertex2i(-width/2, -height/2); glEnd(); glPopMatrix(); } I...just no
|
|
|
Logged
|
|
|
|
roboprez
Level 1
Got to love them pixels
|
|
« Reply #116 on: October 14, 2011, 01:58:21 AM » |
|
I was looking back on some random level generation code I had made and I found this. if (CAPCOM == 0) { if(tunnels[cT].dir==0){ height = rand(rSizeMin, rSizeMax) (... more code)
Wait CAPCOM? }else if (CAPCOM == 1 ||CAPCOM == 2) //Put on another corridor { var randN:int = new int() var tunnelDir:int = new int() if (tunnels[cT].dir == 0) { randN = rand(0, 1) width = rand(tWidthMin, tWidthMax) (blah blah blah)
After a good half hour I worked out that CAPCOM was the result of a dice roll that chooses how many kinks the corridors have. And I called it CAPCOM...
|
|
|
Logged
|
|
|
|
mokesmoe
|
|
« Reply #117 on: December 10, 2011, 02:01:08 AM » |
|
I had some functions inside functions, and it was really hard to read what part did what. Then I had an an idea, and this happened: motion_add ( point_direction ( x+(sprite_width/2), y+(sprite_width/2), other.x+(other.sprite_width/2), other.y+(other.sprite_height/2) ), (other.sprite_width*other.sprite_height*.8)/ ( point_distance ( x+8, y+8, other.x+(other.sprite_width/2), other.y+(other.sprite_height/2) ) *100 ) ) At least I can read it now.
|
|
|
Logged
|
|
|
|
rivon
|
|
« Reply #118 on: December 10, 2011, 09:27:13 AM » |
|
I don't get it. Also, is that Flash or GM? Or something else?
|
|
|
Logged
|
|
|
|
Mikademus
|
|
« Reply #119 on: December 10, 2011, 09:54:01 AM » |
|
I think motion_add is a function that takes the result of a number of calculation as parameters and that he used parentheses around them and indented the calculations as line code for readability.
|
|
|
Logged
|
\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
|
|
|
|