|
Mikademus
|
 |
« Reply #135 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
|
|
|
|
J. R. Hill
|
 |
« Reply #136 on: December 10, 2011, 05:21:36 PM » |
|
Every time I get bored programming, I write an obscure function that is completely unnecessary and I always give it a ridiculous name. E.g. protected function yoDawgLetsSetHimUpTheBomb():int { return thisVariableIsTheCapitalBAsInBoyBombMayne; } Edit: Please tell me I'm not the only one who does this.
|
|
|
|
« Last Edit: December 11, 2011, 09:45:22 PM by J. R. Hill »
|
Logged
|
|
|
|
|
InfiniteStateMachine
|
 |
« Reply #137 on: December 10, 2011, 06:41:10 PM » |
|
urg for some reason I have a weapon factory in my hud namespace. I can't remember when that was supposed to make sense.
|
|
|
|
|
Logged
|
|
|
|
|
Serapth
|
 |
« Reply #138 on: December 12, 2011, 08:41:53 AM » |
|
I don't still have the code, and I didn't actually write it, but I recall coming across:
// whatever you do, don't remove this comment.
And the worst part is, if you removed the comment, everything went to hell in a handbasket. I never did actually hunt down the problem behind this, so no doubt, someone else is going to have inherited the "comment of death" and probably left it in place as well!
|
|
|
|
|
Logged
|
|
|
|
|
rivon
|
 |
« Reply #139 on: December 12, 2011, 03:54:23 PM » |
|
Probably some invisible control character or whitespace thingy... In the IOCCC compo there was once a submission which was empty but was a fully functional C application (at least that's what I read few days ago).
|
|
|
|
|
Logged
|
|
|
|
|
eclectocrat
|
 |
« Reply #140 on: December 12, 2011, 10:33:57 PM » |
|
local tgtx, tgty = action.target:get_location() local fx, fy = action.actor:get_location() local x, y = action.target:get_location()
WTF? How tired was I when I wrote that?! 
|
|
|
|
|
Logged
|
|
|
|
|
Zack Bell
|
 |
« Reply #141 on: December 14, 2011, 12:23:00 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. Oh gosh, haha. This is great.
|
|
|
|
|
Logged
|
|
|
|
|
pixhead
|
 |
« Reply #142 on: December 15, 2011, 02:58:50 PM » |
|
I looked at my old Java project. Not only was is super over engineered, it also had no comments(despite a few here and there). No wonder it turned into a such a freaking mess 
|
|
|
|
|
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.
|
|
|
|
Mikademus
|
 |
« Reply #143 on: December 15, 2011, 03:38:37 PM » |
|
What good is an architecture if you cant have some abstract factory factories accessed through command visitors that are composed by decorations?
|
|
|
|
|
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
|
|
|
|
Klaim
|
 |
« Reply #144 on: December 15, 2011, 03:56:38 PM » |
|
Then let them be generated at compile-time through meta-expressions choosing each possible member functions availability and behaviour depending on your instantiation context. No wait, that's C++. 
|
|
|
|
|
Logged
|
|
|
|
|
J. R. Hill
|
 |
« Reply #145 on: December 15, 2011, 05:00:53 PM » |
|
Having some trouble getting a sprite to animate. Source filename is "static.png" //Actually, it turns out I overrode the entire game's screen refreshing altogether.
|
|
|
|
« Last Edit: December 15, 2011, 05:43:31 PM by J. R. Hill »
|
Logged
|
|
|
|
|
InfiniteStateMachine
|
 |
« Reply #146 on: December 16, 2011, 01:22:08 AM » |
|
What good is an architecture if you cant have some abstract factory factories accessed through command visitors that are composed by decorations?
I just shot myself in the face
|
|
|
|
|
Logged
|
|
|
|
|
InfiniteStateMachine
|
 |
« Reply #147 on: December 16, 2011, 01:24:48 AM » |
|
was just reviewing some old code for an XNA 2D rapid prototyping lib I made a year ago to see if it's viable to release for new students at my college. The fucking basic sprite class is 5 inheritance levels deep. I don't think I've ever come across the need to use about 3 of the the children in that inheritance chain either. Anyways if anyone ever needed an example of someone who is too "class happy" I'm happy to share the source 
|
|
|
|
|
Logged
|
|
|
|
|
Mikademus
|
 |
« Reply #148 on: December 16, 2011, 04:53:53 AM » |
|
Tell the to refactor into a Flyweight State and Command class architecture where the MVC graphics layer is Observing the sprites.
</pattern_jokes>
|
|
|
|
|
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
|
|
|
|
DareM
|
 |
« Reply #149 on: December 16, 2011, 05:18:14 AM » |
|
My coding problem would be trying to follow the simple rule : less code is better.
This would make me try to squeeze way too much into a single line, everything in a single file.
You can imagine that more compressed does not necessarily mean less code but it certainly means less readable and less reusable.
I am trying to cure myself of this disease but there's certainly no quick way.
|
|
|
|
|
Logged
|
|
|
|
|