Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879624 Posts in 32994 Topics- by 24374 Members - Latest Member: Krall

May 24, 2013, 01:11:16 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Post if you just laughed at your code.
Pages: 1 ... 10 11 [12] 13 14 ... 29
Print
Author Topic: Post if you just laughed at your code.  (Read 36359 times)
Geti
Level 10
*****



View Profile WWW
« Reply #165 on: April 29, 2012, 01:43:40 AM »

^ this is why whitespace is a good thing.
Logged

pixhead
Level 4
****


fish_master57@hotmail.com
View Profile Email
« Reply #166 on: April 29, 2012, 05:33:47 PM »

^ this is why whitespace is a good thing.

this is why quotes are a good thing Smiley
Logged

"Games are made by artists, so to not consider them art is an insult to the artists who work on them." - Some guy on IGN.
st33d
Guest
« Reply #167 on: April 30, 2012, 08:13:45 AM »

You may get a rise from this:

Code:
// may god forgive me for this if statement:
if(
!layers[ENTITIES][r][c] &&
layers[BLOCKS][r][c] != 1 &&
(
(
(
critterId == MapTileConverter.RAT ||
critterId == MapTileConverter.COG_RAT
)&&
(
bitmap.bitmapData.getPixel32(c, r + 1) == MapBitmap.LEDGE ||
bitmap.bitmapData.getPixel32(c, r + 1) == MapBitmap.LADDER_LEDGE ||
layers[BLOCKS][r + 1][c] == MapTileConverter.WALL
)
) ||
(
(
critterId == MapTileConverter.SPIDER ||
critterId == MapTileConverter.BAT ||
critterId == MapTileConverter.COG_SPIDER ||
critterId == MapTileConverter.COG_BAT
) &&
(
layers[BLOCKS][r - 1][c] == MapTileConverter.WALL &&
bitmap.bitmapData.getPixel32(c, r - 1) != MapBitmap.PIT
)
) ||
(
critterId == MapTileConverter.COG &&
(
(
layers[BLOCKS][r - 1][c] == MapTileConverter.WALL &&
bitmap.bitmapData.getPixel32(c, r - 1) != MapBitmap.PIT
) ||
layers[BLOCKS][r + 1][c] == MapTileConverter.WALL ||
layers[BLOCKS][r][c - 1] == MapTileConverter.WALL ||
layers[BLOCKS][r][c + 1] == MapTileConverter.WALL
)
)
)
){
layers[ENTITIES][r][c] = critterId;
critterNum--;
}
Logged
Sakar
Level 9
****


Je suis le chat


View Profile WWW Email
« Reply #168 on: April 30, 2012, 08:32:34 AM »

WTF

That...that just...

Wow
Logged

Site | Twitter
John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #169 on: April 30, 2012, 08:46:30 AM »

class Person extends Flammable
Logged
ThemsAllTook
Moderator
Level 8
******


Alex Diener


View Profile WWW
« Reply #170 on: April 30, 2012, 09:00:19 AM »

My goodness, st33d, that's a train wreck. Temporary variables exist for a reason!
Logged
Fallsburg
Level 10
*****


Fear the CircleCat


View Profile WWW
« Reply #171 on: April 30, 2012, 09:44:54 AM »

class Person extends Flammable

Huh, I have:

class Person implements IFlammable

Great minds and such.
Logged

omgnoseat
Level 2
**



View Profile
« Reply #172 on: April 30, 2012, 01:04:56 PM »

I was working on collision detection, and wanted to save the penetration depth (overlap) of the collision.

Code:
double penetration
Logged
st33d
Guest
« Reply #173 on: April 30, 2012, 02:59:17 PM »

My goodness, st33d, that's a train wreck. Temporary variables exist for a reason!

Procedural level generation rules. It handles dumping scenery that I'm constantly re-editing.

I might tidy it up.

I might just leave it to bewilder future generations. (Seeing as it runs fairly faster than loading into variables.)

Ah the joy of open source software development.
Logged
fecal_brunch
Level 0
***



View Profile Email
« Reply #174 on: April 30, 2012, 03:12:56 PM »

Code:
if(newLine)
   newLine = !newLine

Could somebody explain this to me pls?
Logged

-Rhys
zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #175 on: April 30, 2012, 03:15:51 PM »

Code:
if(newLine)
   newLine = !newLine

Could somebody explain this to me pls?
If it's not zero, set it to NOT itself. NOT itself if it's any number besides 0 makes it equals zero. It's the equivalent of newLine=0
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
Geti
Level 10
*****



View Profile WWW
« Reply #176 on: May 01, 2012, 12:38:25 AM »

^ this is why whitespace is a good thing.

this is why quotes are a good thing Smiley
smartarse, haha.

-hardcore collision detection-
made me chuckle
Logged

fecal_brunch
Level 0
***



View Profile Email
« Reply #177 on: May 01, 2012, 01:19:23 AM »

Code:
if(newLine)
   newLine = !newLine

Could somebody explain this to me pls?
If it's not zero, set it to NOT itself. NOT itself if it's any number besides 0 makes it equals zero. It's the equivalent of newLine=0

Right, that's what I thought. So it's just a really bizarre thing to write... I wonder what the thought process was.
Logged

-Rhys
pixhead
Level 4
****


fish_master57@hotmail.com
View Profile Email
« Reply #178 on: May 01, 2012, 01:24:19 AM »

Code:
if(newLine)
   newLine = !newLine

even better I forgot to tell you newLine is a boolean varible Cheesy
Logged

"Games are made by artists, so to not consider them art is an insult to the artists who work on them." - Some guy on IGN.
kw
Level 0
**



View Profile Email
« Reply #179 on: May 01, 2012, 02:29:36 AM »

 Cheesy

Code:
void Update() {
if(Input.GetKey(KeyCode.LeftShift) && !isSprintEnabled) {
EnableSprint();
} else if(!Input.GetKey(KeyCode.LeftShit) && isSprintEnabled) {
DisableSprint();
}
}

and Error:

Code:
Error CSO117: 'UnityEngine.KeyCode' does not contain a definition for 'LeftShit'.
Logged
Pages: 1 ... 10 11 [12] 13 14 ... 29
Print
Jump to:  

Theme orange-lt created by panic