I've finally been able to force myself to start programming again! Good times. @steemj breaking my Cards Against Humanity dapp was demoralizing, but I enjoy programming and I'm glad to be getting back into the swing of things. It's been a while so I'm a bit rusty.
Games
I've always wanted to program games. Ever since I was a kid I've always thought video games were magic. How could one possibly create a responsive and dynamic system of graphics controlled by a player and displayed by a monitor? The amount of technology it even takes to even run a simple "Hello World" program is astounding. For you non-programmers out there "Hello World" is the first program you ever create in a language. It simply prints "Hello World" to the screen.
I have a lot of experience with games and how they should operate. World of Warcraft has sucked over 400 days (9600 hours straight) out of my life. As much as that is an embarrassing waste of time I can also use it to my advantage. I've made over $1000 in the World of Warcraft economy and I've made over $1000 in the Diablo 3 economy.
I have a friend who used to work for Blizzard Entertainment. He was there for decades. He loved his job and would gladly work 80 hour weeks. He also would get like four hours sleep or less or night. The guy is a total madman work horse... it's astounding. Anyway, on the off chance we would get to hang out we would talk about game mechanics. We talked about a lot of ideas that ended up being implemented into Blizzard games. He never really gave me any credit for the ideas which was fine. Doing so would have been legally ambiguous. I gave my ideas freely to him and I was happy to see many of them come to life.
The point here is that I have good ideas and I know how game economies should run. If I can make $5 an hour playing video games on the platform of a greedy corporation, just think of the things I could do on the blockchain where there is no centralized entity greedily sucking down all the profits. I believe that skilled players of a complex blockchain RPG could be making $10-$20 an hour simply playing a video game. Not only that, I believe that by implementing proof of brain and a development sandbox, talented users that helped develop the game would get paid even more.
It all depends on how many whales are supporting the the game platform. After seeing such massive support for Steem Monsters I can't help but feel like we are sitting on an untapped gold mine. This mountain is just waiting to be blown up with dynamite by innovative developers, and doing so will shower gold across the entire crypto valley.
Back to the Basics
Yesterday I realized that I want to make games for the blockchain, but I've never even programmed the simple games before. This is a good exercise to get me back into the swing of things. I'm going to create a few of the old classic board games like checkers, chess, reversi, and Go. I'm starting in Java and may move it into JavaScript in order to make the transition to the blockchain easier. Man I really need to learn JavaScript.
With Tron releasing their virtual machine at the end of the month this couldn't come at a better time. Java uses a virtual machine and I've read that Tron's main language will be Java. I have to assume that my Java projects will be much easier to port to Tron at the end of the month. Not to worry, I'm going to program my apps to be as modular as possible. I believe it will be a relatively trivial process to plug my games into multiple blockchains.
That being said it would be nice if @fulltimegeek would share his code for making Steem API calls with Java using no dependencies. That sure would be helpful at a time like this.
Inheritance
Inheritance is a programming concept they tried to teach me in school but I've never really used it. I'm attempting to force myself to use it now so I learn something. Using inheritance, you can create tiered child objects that inherit the properties of the parent object.
For example, I made an class called BoardPiece. A BoardPiece could be a Checkers, Reversi, or Go piece. It has a color, x/y positioning, and active status:
public class BoardPiece { String color; int x; int y; boolean active;
However, what if the game has multiple pieces like chess? BoardPiece fails to meet this requirement. Do we add a "String type;" to BoardPiece even though it isn't needed for most of the games? No, instead I'll use inheritance by creating a new class called ChessPiece:
public class ChessPiece extends BoardPiece{ String type;
ChessPiece(String type, String color, int x, int y) { super(color, x, y); this.type = type; }
By extending BoardPiece with ChessPiece we keep everything simpler and more organized. Another thing I'll have to add to ChessPiece is how all the different pieces are allowed to move. In Checkers, Reversi, and Go the rules for placement are the same for every piece because there are no different pieces. (Damn... I might have to make a CheckersPiece for king pieces.)
Inheritance is one of many tools that makes Object Oriented Programming so powerful. As projects get larger the complexity can get out of control if you don't simplify it with these strategies.
Hopefully I haven't bored all you non-programmers out there. Stay classy.
Return from Back in the Saddle to edicted's Web3 Blog