1. March 23, 2010 by Stone

    Well, honestly, I haven’t updated this in a while. I just keep getting busy, and I didn’t finish the Java book.

    I am at an interesting, but difficult stage of my learning right now, and I can use some recommendations…

    I understand Object Oriented Programming. I understand classes, and objects, and instances, and extending objects, and methods and properties. I could write a program in an object oriented fashion without much difficulty.

    Java itself seems to be the issue. It’s mostly syntax issues I’m having still. I don’t completely understand the declarations the book I’ve been using is having me make, so I’m not sure which parts of what I’m using are actually doing what I want. This is making it very hard to stray at all from the book. If I make a slight change to anything, I seem to break the examples.

    I’m wondering at this point if there is an easier Object Oriented language, or at least a better Java book out there. Any suggestions?


  2. It’s funny, actually.

    January 28, 2010 by Stone

    I have a number of subscribers, and I delete a few spam comments, but it is funny to me how many of you remain anonymous. A few of you probably really do read these, and I would love to get your opinions and comments.

    Please, reply, let other people know that of the 19 users who don’t appear to be spambots, you are real, and you have an opinion.

    And an update: Java is going well, but it has been a rough couple of weeks and I’m a few chapters behind. I just got to the one about making the application run in it’s own window (awesome!), so I will be putting up some samples and some code in the next few weeks.


  3. Java: What is OOP?

    December 28, 2009 by Stone

    For the people who are not nerds that are reading this (all 1 of you), you may be wondering what Object Oriented Programming (or OOP) is, and why you should care. Really, you probably don’t need to care about it, but for someone like me, it represents an efficient and scalable way of writing code. The idea is that anything you might interact with in a program is actually just an existence of that type of object. To put it another way, you might have a dog. I also have a dog. If this were a program, both of our dogs would be part of the Dog class. This handles things that all members of the class Dog should be able to do, such as eat, bark, and poop. These are things our dogs have in common. If caring for your dog were a computer program, you wouldn’t be caring for just any dog, but your specific dog. My dog is named Chester. Chester is a different dog than Fluffy. They are completely separate, and have no relationship beyond both being dogs. They can have different names, different species, different eating habits, whatever, and what happens to one doesn’t affect the other. My dog is a Cocker Spaniel. His breed has no effect at all on Fluffy. In a programming sense, this makes sense. Suppose I write a game in which you catch a ball. Any time you play the game, the ball is the same, right? Now suppose I make another game in which you have a ball and you bounce it on the ground (these are boring games, but good examples).

    Which sounds better to you:
    a)Taking the same ball you just caught, and bouncing it on the ground.
    b)Taking the ball you just caught, putting it away, getting a new one (making a new one in this case), that is nearly identical to the first one, and bouncing that.

    I hope you said A. This is the big benefit to object oriented programming. I can re-use the ball anywhere I need a ball. If in a new game, I want the ball to be deflatable, I can add the property to the ball in that game without changing the rest of them (by extending it for those who know the terminology). If I decide that I got the concept of a ball wrong, and it should be square instead of round, I can change the ball class to match this, and it will become square in all the places that it is used. But still, only the one set up to be able to deflate will be able to.

    I hope that made sense. In terms of the Roguelike I hope to write, this should mean that things in the game can be simplified heavily. A dragon is the same thing as a cockroach: both are part of a group called “monsters” (or maybe “enemies”). What makes the dragon big, scary, green, fire-breathing, or two-headed is all set after the program already understands that it is a monster, and has the properties of a monster (HP, experience point value, etc.). I could set up any number of monsters in this way no matter how different:
    name:”giant ant”
    description: “a giant ant. Quick, get a can of bugspray!”
    HP: 1
    exp value: 1
    damage: 1
    message to the player: “I’m a giant red ant. just step on me.”
    and
    name:”big ogre”
    description:”A big mean looking giant with one eye. It is staring directly at you, as though it can see your soul.”
    HP: 150
    exp value: 200
    damage: 100
    message to the player: “ROAR! BIG OGRE CRUSH YOU, PUNY HUMAN!”

    and the game can handle both of those. In this way, you can encounter a wider variety of enemies, and I didn’t have to script each one on it’s own, just fill in a few blank spots.