Followers 0

# Games by younger me

## 15 posts in this topic

ah, if only i had the code from some of my very earliest games, they were travesty's to say the least. (i once wrote risk in lua, with no concept of loops, and functions....the file was well over several megs big, had multiple repeated sections of code, and was so incredibly bloated, it only partially functioned, but overall was just....terrible...*shudders*)

is this game based on some existing game, or is it an original construction?

edit: i should re-phase, because i do think i may have had an understanding of functions at the time, but not how to utilize them correctly, which lead to me re-writing massive portions of the game, that could have been neatly summed into functions.  also, combined with no real knowledge of for-loops i was hand-writing massive loops, and hard-coding country borders.

Edited by slicer4ever
0

##### Share on other sites

It's pure copy of Nine Men's Morris board game. It was easier for me (and still is; there is still long way to go for me to design new games) to use existing games as a core or entire project. It should've been easy to "convert" it into digital format due to its simple board and rules. I just had to use that thing in my head called "brain".

Oh well, everybody has to start from somewhere, right? XD

EDIT: Even today, I still find myself not utilizing what C# has to offer and instead rewriting massive pieces of code. I passed several times over the code of Battle City and found numerous situations where I could (and did) eliminate copies of code and replace them with one or two methods which do the same job, but better. In the above code, all that placement could easily be summarized into 1 void method with 2 to 4 parameters, instead of doing massive if...then...else if.. tree which is insanely hard to read.

Edited by Aurioch
0

##### Share on other sites

"It's okay. My state machine just uses code instead of memory."

1

##### Share on other sites

This is gonna be hard to beat, but look at my first games Menu.h file This was written about 3 years ago as well The funny part, game works perfectly fine here is a video of it http://www.youtube.com/watch?v=4y-5io98vys

That's not terrible, I have (many times) seen worse stuff, written by supposed professionals...

1

##### Share on other sites

I see it as very bad. It used to be about getting something working, now it's about getting something working in optimized way hehe :)

I can't really imagine anything worse tho. What could they do, What can be worse then having 3000 if statements in one file .h file under one function?

...Memory Leaks?

0

##### Share on other sites

This is gonna be hard to beat, but look at my first games Menu.h file This was written about 3 years ago as well The funny part, game works perfectly fine here is a video of it http://www.youtube.com/watch?v=4y-5io98vys

That's not terrible, I have (many times) seen worse stuff, written by supposed professionals...

There is worse out there, but it's still terrible. ;)

0

##### Share on other sites

If I would write it right now, I would make field on board as its own class. That way, in main code I can simply hold a list of fields and manipulate with it, instead of... doing... what I did.

Been there, done that... share your pain, and shame. Just when I thought programming was about handling each case individually with a series of Ifs :)

0

##### Share on other sites

Phew, weekend started, now I finally have time to be here a little XD

Wow, game looks nice. As for the code... at least it's readable XD Now, if you would want to make one change, would you be able to do it without breaking whole thing? XXDD

@Arthur Souza

Thanks... I guess XD Wrote first thing which came to my mind, and LotR ended up being that...

@Orymus3

People learn whole life ^^ Luckily, I improved my code writing... curently I have about 30 classes of my own all communicating with other objects and/or inheriting other classes - something younger me wouldn't even think about doing.

What's even more embarrasing is that instead of using Rectangle to represent each board field and just use Rectangle.Contains(Point) method, I invented hot water. >.<

0

##### Share on other sites

Phew, weekend started, now I finally have time to be here a little XD

Wow, game looks nice. As for the code... at least it's readable XD Now, if you would want to make one change, would you be able to do it without breaking whole thing? XXDD

Well probably not, I haven't touched this code in over 3 years. Now I would use classes and functions for this like any normal person :)

0

##### Share on other sites

When I started XNA, I used to load files whenever I needed them. I recently found my first pong game and I had Content.Load lines all over the place. The nice thing about XNA is that it still worked!! But with a bigger project you  probably don't want Content.Load in the Update or Draw method -.-

0

##### Share on other sites

I made multi threaded code without even knowing I was doing it before...  that was many years ago.

0

##### Share on other sites

That reminds me of how I still tend to avoid multithreading like the plague as if I had never used it... even after making a whole sound driver that has to cope with two completely different processors without any proper way to do handshake and the most atomic operation I can get is reading or writing a byte in RAM (I don't even get multibyte values!), which must be like the worst of the worst when it comes to multithreading =P

The only time I did it on PC (that didn't involve other library doing it for me - the one I mentioned before was not on PC) was recently in my game for the loading screen (otherwise the game can hang without pumping any events, which can make the OS think it got stuck and try to kill it). Given what I said above, I guess it shouldn't be surprising that it worked on the first try (even if it was quite simplistic).

Edited by Sik_the_hedgehog
0

##### Share on other sites

Goodie goodie, look what I found on my old PC from 1991

Few years ago, I was bored on vacation and all other electronic devices were used by other family members, so I wrote this little gem in QBasic which needs serious refactoring:

CLS

DIM a, b, i, n, s AS INTEGER
DIM button AS STRING
DIM direction AS STRING
DIM x(100) AS INTEGER
DIM y(100) AS INTEGER

s = 0
n = 1
direction = ""
x(1) = 12 '25 max
y(1) = 40 '80 max
RANDOMIZE 1
a = INT(RND * 20) + 3
b = INT(RND * 77) + 2

COLOR 9
PRINT "Welcome to Aurioch's ASCII Snake"
COLOR 3
PRINT CHR$(201); STRING$(78, 205); CHR$(187) FOR i = 1 TO 20 PRINT CHR$(186); STRING$(78, " "); CHR$(186)
NEXT i
PRINT CHR$(200); STRING$(78, 205); CHR$(188) LOCATE 1, 60 COLOR 12 PRINT "Score:"; S DO FOR i = 1 TO n LOCATE x(i), y(i) COLOR 10 IF i = 1 THEN PRINT CHR$(2)
ELSE
PRINT CHR$(254) END IF NEXT i LOCATE a, b COLOR 14 PRINT CHR$(42)
FOR i = 1 TO 5000 'delay
NEXT i
button = INKEY$FOR i = 1 TO n LOCATE x(i), y(i) PRINT " " NEXT i IF button = "w" THEN direction = "up" IF button = "s" THEN direction = "down" IF button = "a" THEN direction = "left" IF button = "d" THEN direction = "right" IF (direction = "up") AND (x(1) > 3) THEN IF n > 1 THEN FOR i = n TO 2 STEP -1 x(i) = x(i - 1) y(i) = y(i - 1) NEXT i END IF x(1) = x(1) - 1 END IF IF (direction = "right") AND (y(1) < 79) THEN IF n > 1 THEN FOR i = n TO 2 STEP -1 x(i) = x(i - 1) y(i) = y(i - 1) NEXT i END IF y(1) = y(1) + 1 END IF IF (direction = "down") AND (x(1) < 22) THEN IF n > 1 THEN FOR i = n TO 2 STEP -1 x(i) = x(i - 1) y(i) = y(i - 1) NEXT i END IF x(1) = x(1) + 1 END IF IF (direction = "left") AND (y(1) > 2) THEN IF n > 1 THEN FOR i = n TO 2 STEP -1 x(i) = x(i - 1) y(i) = y(i - 1) NEXT i END IF y(1) = y(1) + 1 END IF IF (x(1) = a) AND (y(1) = b) THEN a = INT(RND * 20) + 3 b = INT(RND * 77) + 2 s = s + n n = n + 1 IF direction = "up" THEN x(n) = x(1) + 1 y(n) = y(1) END IF IF direction = "down" THEN x(n) = x(1) - 1 y(n) = y(1) END IF IF direction = "left" THEN x(n) = x(1) y(n) = y(1) + 1 END IF IF direction = "right" THEN x(n) = x(1) y(n) = y(1) - 1 END IF LOCATE 1, 66 PRINT s END IF LOOP UNTIL button = CHR$(27)
COLOR 7
END


Yesterday, I was rewriting it on my laptop and noticed that I made game loop without knowing about it at all XD

Edited by Aurioch
0

## Create an account

Register a new account