Game Source Codes released
category: code [glöplog]
Hi,
You can now get the source codes of several of my games (Mega Force, Evolution, Adoktris, Adok's Magic Cube, Adok's Saturn Puzzle) from my GitHub page: https://github.com/adokhugi
Most of the games were made using Visual C++ and OpenGL, only Mega Force was made using Visual C# and MonoGame.
In Adok's Magic Cube, the rotation was especially difficult to implement. I wondered for this reason whether I should really release the code, but in the end I opted for altruism.
Cheers!
You can now get the source codes of several of my games (Mega Force, Evolution, Adoktris, Adok's Magic Cube, Adok's Saturn Puzzle) from my GitHub page: https://github.com/adokhugi
Most of the games were made using Visual C++ and OpenGL, only Mega Force was made using Visual C# and MonoGame.
In Adok's Magic Cube, the rotation was especially difficult to implement. I wondered for this reason whether I should really release the code, but in the end I opted for altruism.
Cheers!
Thank you so much, I've been eagerly awaiting this day! I bet generations of young coders to come will be inspired by the the genius and elegancy of that rotation algorithm.
But behold, what will you do when Zuckerberg or Musk will copy it and use it in their upcoming VR magic cubes? You should add a licence to make sure this act of altruism won't backfire!
But behold, what will you do when Zuckerberg or Musk will copy it and use it in their upcoming VR magic cubes? You should add a licence to make sure this act of altruism won't backfire!
Wow, this code really is a feast for the eyes. Always a pleasure to see a "pro software engineer" at work!
Code:
tempColor [0] = faces [faces [front].fields [0].borders [1].faceNum].fields [faces [front].fields [0].borders [1].fieldNum].color;
tempColor [1] = faces [faces [front].fields [1].borders [0].faceNum].fields [faces [front].fields [1].borders [0].fieldNum].color;
tempColor [2] = faces [faces [front].fields [2].borders [0].faceNum].fields [faces [front].fields [2].borders [0].fieldNum].color;
faces [faces [front].fields [0].borders [1].faceNum].fields [faces [front].fields [0].borders [1].fieldNum].color =
faces [faces [front].fields [2].borders [1].faceNum].fields [faces [front].fields [2].borders [1].fieldNum].color;
faces [faces [front].fields [1].borders [0].faceNum].fields [faces [front].fields [1].borders [0].fieldNum].color =
faces [faces [front].fields [5].borders [0].faceNum].fields [faces [front].fields [5].borders [0].fieldNum].color;
faces [faces [front].fields [2].borders [0].faceNum].fields [faces [front].fields [2].borders [0].fieldNum].color =
faces [faces [front].fields [8].borders [0].faceNum].fields [faces [front].fields [8].borders [0].fieldNum].color;
faces [faces [front].fields [2].borders [1].faceNum].fields [faces [front].fields [2].borders [1].fieldNum].color =
faces [faces [front].fields [8].borders [1].faceNum].fields [faces [front].fields [8].borders [1].fieldNum].color;
faces [faces [front].fields [5].borders [0].faceNum].fields [faces [front].fields [5].borders [0].fieldNum].color =
faces [faces [front].fields [7].borders [0].faceNum].fields [faces [front].fields [7].borders [0].fieldNum].color;
faces [faces [front].fields [8].borders [0].faceNum].fields [faces [front].fields [8].borders [0].fieldNum].color =
faces [faces [front].fields [6].borders [0].faceNum].fields [faces [front].fields [6].borders [0].fieldNum].color;
faces [faces [front].fields [8].borders [1].faceNum].fields [faces [front].fields [8].borders [1].fieldNum].color =
faces [faces [front].fields [6].borders [1].faceNum].fields [faces [front].fields [6].borders [1].fieldNum].color;
faces [faces [front].fields [7].borders [0].faceNum].fields [faces [front].fields [7].borders [0].fieldNum].color =
faces [faces [front].fields [3].borders [0].faceNum].fields [faces [front].fields [3].borders [0].fieldNum].color;
faces [faces [front].fields [6].borders [0].faceNum].fields [faces [front].fields [6].borders [0].fieldNum].color =
faces [faces [front].fields [0].borders [0].faceNum].fields [faces [front].fields [0].borders [0].fieldNum].color;
faces [faces [front].fields [6].borders [1].faceNum].fields [faces [front].fields [6].borders [1].fieldNum].color =
tempColor [0];
faces [faces [front].fields [3].borders [0].faceNum].fields [faces [front].fields [3].borders [0].fieldNum].color =
tempColor [1];
faces [faces [front].fields [0].borders [0].faceNum].fields [faces [front].fields [0].borders [0].fieldNum].color =
tempColor [2];
isn't rotation, like, simple matrix algebra tho? ;-)
sophisticated optimizations making it hard then?
@rob: Jesus holy Christ
sophisticated optimizations making it hard then?
@rob: Jesus holy Christ
Massive Adok TECH attack.
You're brilliant! What a novel design. Come to Baltimore at once.
Quote:
[…] in the end I opted for altruism.
That is so not how altruism works.
I noticed a memory leak here. Those temporary char arrays are heap-allocated on every call of CalculateTimeDisplay (every frame?) but never free'd.
Quote:
I noticed a memory leak here. Those temporary char arrays are heap-allocated on every call of CalculateTimeDisplay (every frame?) but never free'd.
There are 24 new-s in the file and 0 delete-s.
It looks like generally in this old code you are never using operator delete to free up memory allocated with operator new actually...
Yeah, what Gargaj said.
That whole function should just be an sprintf anyway.
A man releases his code, and the others (at least some) are just... Well, just hate...
If you do not like it (or the dude), do NOT look at it. Do not "waste" your time (if it is lame, or not Farbrausch-like or from your hero).
Be well...
If you do not like it (or the dude), do NOT look at it. Do not "waste" your time (if it is lame, or not Farbrausch-like or from your hero).
Be well...
or maybe we're just altruistically doing a code review to help Adok improve his rotations!
People would be surprised to see how unprofessional sometimes the code is from certain very professional and popular projects! :D
A beginner writes terrible code. The hobbyist slightly better. An junior professional writes complicated but mostly solid stuff. Mid-range professional writes solid to excellent code that does its job without any nonsense. A senior, experienced professional writes consistently excellent code with absoloutely terrible bits in it, because they know when it matters and when it doesn't.
This stuff I would not send along my application for a job.
This stuff I would not send along my application for a job.
Quote:
or maybe we're just altruistically doing a code review to help Adok improve his rotations!
(^_^)=d[¨]
Just found this gem in my old Atsou demo source (first C code I ever wrote)
https://i.redd.it/94a8xxdukhz91.png
https://i.redd.it/94a8xxdukhz91.png
A man altruistically releases his code. It’s terrible and we all laugh. What a fun weekend, maybe the real code is the friends we made along the way.
Quote:
A man releases his code, and the others (at least some) are just... Well, just hate...
As already said on the oneliner, sharing code is always a cool move - just don't pat yourself on the back for it overly and drivel about altruism
@okkie: maybe the real scene is the scene we made along the way…
It sure looks nicer than all the code for the games I've thought about but never made.
I've now also added the code of my demo "Ruky hore" and my 256b intro series "Indian" to my GitHub account.
Awesome code, thanks.