Cheese and crackers!
Before I started working earlier tonight, I cleaned up the desktop on my laptop. I’ve been doing stuff all night and now when I turn it on again and see the mostly empty desktop, it’s like a stark white barren plane!
Anyways I’ve settled down from my anxiety and I’m going to take another crack at TextWorld tonight.
*work work work read read read work work work* Alright, I’ve determined that HaXe has a way of refering to functions with variables. It’s just that you have to define the arguments and return type of the function reference when you declare it. As such, all of the action functions will have to take the same parameters.
Okay so let’s see… When you click on some highlighted text, how does it determine what goes in the context menu? I was thinking about having the context menus be a property of a thing, but what if some of the options don’t make sense in the context you’re clicking on the thing in?
I’m thinking it’ll run a generate context menu function instead. It’ll look at the situation and give you options of what to do with the thing.
Ohhh… I just had an idea.
What if instead of using context menus, when you click on something in the location text, it puts the description of the thing in the action text, along with options of what you could do. And if you click those and they need more choices, more options could be added to the action text!
It might go something like this:
You are within a deep forest. You see a ball.
Click on ball.
It looks like a blue rubber ball, about twelve centimeters in diameter.
Would you like to do something with the ball?
Click on do something with the ball.
Get the Ball? Touch the Ball? Strike the Ball?
Click on get the ball.
You pick up the ball, and hold it in your hands.
That’s more organic than having dialogs popping up all over, I think. ^.^
Alright. Let’s go over the game loop.
The game has begun, and the world has loaded. The player thing is in the starting space.
Assemble the location text, by checking the player’s position and sight range, and the connecting regions.
Assemble the status text, checking the player’s status and senses and revealing them.
Assemble the action text, appending new entries and if neccesary, removing old entries from the top of the pile.
Wait for player to click a link.
Respond to a link by running the action assigned to it.
That’s basically it, I think. The rest is developing the data classes and breaking down those major tasks into individual steps.
Hmm… The List class doesn’t do direct access. I’ll have to use an Array instead.
Okay, so the first thing I’m going to do is make a class that generates a world. In order to do that I need to flesh out the data classes thing, space, exit, and mobile.
I’ll give a thing properties for length, width, and height, which can be compared to, in order to determine if a given thing is bigger or smaller than the player.
Hmm… The more I do the more there is to do. I’m starting to seriously reconsider my plans for this. While I’d like to do some world simulation, the goal of this project turned away from simulating worlds and towards making money by creating a sort of interactive fiction.
I think maybe I should branch off and make the IF project completely different from the TextWorld project, and make it a much simpler format.
I think I need to take a break and think about that.