I didn't do one thing on my app over the last 1 week and 1 day. But I actually have a good reason. I was developing a new website for the bookshop that my wife and I own. We decided to buy into the e-commerce solution that the American Booksellers Association (ABA) offers to its members. The price of opting into their solution used to be too cost prohibitive for the ROI (return on investment). We're a tiny shop and our "fan base" just isn't that rabid, so once the e-commerce solution goes live I doubt we'll make that much from it, but at only $100 a month to use it, it was too inexpensive not to try. Previously, they charged a setup fee and the monthly was $250. Also, they now offer Google ebooks, so that was the primary reason I showed renewed interest.
So for the last week I've been using all of my free time to develop the website: thebookerynook.com (feel free to buy an ebook from us!).
Okay, back to the game. I abandoned my latest idea (there were buckets and witches and stuff). I still like the idea and will try to pursue it later. But as I was developing it, and had most of the game-play finished, I realized the rest of the game was too big for me at this moment. It would have been along the lines of Angry Birds. So I would need to develop 20 scenes per level with high scores and the ability to go to any already-completed level and ... well ... it was overwhelming. So I backed up and thought about a game or an app that would be "easy" to do. Where "easy" means no scoring, no levels, no worrying about getting scores up to Facebook, etc.
I did a lot of brainstorming by myself and with my wife. One idea I've toyed with before and came back to here was a maze. I assume mazes have been done and, quite frankly, I wasn't sure how to have a real maze and keep an avatar centered along the walls of the maze as a player moves it around with their finger. But the idea kept bubbling up until I married it with another idea: board games.
I've decided to build a game where the player cannot see any paths, just squares and as they travel, trying to find their, way, obstacles (ala a board game) pop up, sending them backwards, sending forwards, sending them to a different area of the board. And, you know, so on.
This is my journey into the dank labyrinths of mobile device programming. From my very first neo-neophyte day to today.
Sunday, February 27, 2011
Sunday, February 13, 2011
Annnnnd ... action!
I have the very basics of the game finished: user can move boards (platforms) around and then pour water to melt the witch. There is definitely some refining to do. However, I need to start building the "game" - the levels/scenes/etc. So I'm going to start learning Director class. I'm still not sure of all that it does, but from reading the forum or it, it seems like a good backbone for building a game. You use it to define
I assume the name "Director" is just something that the developer (Ricardo Rauber Pereira) decided to call it. I also assume that class is specific to either Lua, Corona, or more likely, programming in general. So let me search the Great Big InterWeb to see what I kind find for the definition. Be right back.
Okay, "class" has at least two possible meanings. In OOP (object-oriented programming), a class is a category of objects. The example the Web dictionary had was a class named "shape", and in that class you have objects (along with their properties) of circles, rectangles, squares, and so on. In .NET languages (no idea what these are, has something to do with Microsoft), a class is a template.
The Director class in Corona seems more like a template, but you also define your objects. I think classes in Corona are APIs on steroids, containing functions and object descriptions.
I assume the name "Director" is just something that the developer (Ricardo Rauber Pereira) decided to call it. I also assume that class is specific to either Lua, Corona, or more likely, programming in general. So let me search the Great Big InterWeb to see what I kind find for the definition. Be right back.
Okay, "class" has at least two possible meanings. In OOP (object-oriented programming), a class is a category of objects. The example the Web dictionary had was a class named "shape", and in that class you have objects (along with their properties) of circles, rectangles, squares, and so on. In .NET languages (no idea what these are, has something to do with Microsoft), a class is a template.
The Director class in Corona seems more like a template, but you also define your objects. I think classes in Corona are APIs on steroids, containing functions and object descriptions.
Tuesday, February 8, 2011
Can't touch this
It's amazing how many blind alleys I enter when trying to program. Because I don't know how Lua or Corona really work I spend a lot of time and energy pursuing thoughts only to find, eventually, that I just can't get it to work that way. Spent the last two days trying to figure out how to enlarge a touch area. When I tried my game on my Android phone, the pieces were so small that it was very difficult to focus on them and drag them (or activate the bucket to pour the water). So I went to the forums and found something that might have worked: you put a larger, invisible rectangle in front of the small object. Worked great with the bucket, not so great with the boards that you drag to direct the falling water. I used display groups to link the rectangle and smaller object.
A group is like a bag and you can put your display objects into that bag so you can do things to all of the images at one time. It's a way to organize and a way to manipulate your display objects (images). Problem is, once you group them the physics engine in Corona doesn't work very well. So after I grouped the small board with the larger invisible rectangle, I could move them easily, but the water balls fell right through.
And that's when I tried different things. Tried to weld the two objects together. After wasting an hour or two I find out that you can only weld "dynamic" objects together. Well, a dynamic object reacts to the gravity of the physics engine, so the board and rectangle fall to "earth" and can't be moved to a specific area.
Then I took a detour through waste-your-time-ville and for some reason thought it would be a good idea to remove the physics from the target object. You see, I had the target object set up as a physics body so that when the water balls hit it I could have the object melt. That was working fine before, I have no idea why I decided it would be better to get rid of that. So I spent hours trying to make the code work in a way that it can't (or, more exactly, in a way that I don't know how to control it).
After a frustrating two days I find myself no further along. However, as others have said, there are no mistakes, only lessons to learn. I have learned more about coding and how Lua and how Corona work (and don't work). So that's something.
A group is like a bag and you can put your display objects into that bag so you can do things to all of the images at one time. It's a way to organize and a way to manipulate your display objects (images). Problem is, once you group them the physics engine in Corona doesn't work very well. So after I grouped the small board with the larger invisible rectangle, I could move them easily, but the water balls fell right through.
And that's when I tried different things. Tried to weld the two objects together. After wasting an hour or two I find out that you can only weld "dynamic" objects together. Well, a dynamic object reacts to the gravity of the physics engine, so the board and rectangle fall to "earth" and can't be moved to a specific area.
Then I took a detour through waste-your-time-ville and for some reason thought it would be a good idea to remove the physics from the target object. You see, I had the target object set up as a physics body so that when the water balls hit it I could have the object melt. That was working fine before, I have no idea why I decided it would be better to get rid of that. So I spent hours trying to make the code work in a way that it can't (or, more exactly, in a way that I don't know how to control it).
After a frustrating two days I find myself no further along. However, as others have said, there are no mistakes, only lessons to learn. I have learned more about coding and how Lua and how Corona work (and don't work). So that's something.
Sunday, February 6, 2011
It's just like starting over
I spent this week starting over. I scrapped everything I had because I only vaguely understood part of it and didn't understand other parts at all. I then began to recreate everything one piece at a time, using it only when I understood what the piece did.
So I'm pretty much back to where I was before I scrapped everything ... except with a much better understanding of what's going on with the code. I take that back. I'm ahead of where I was.
So I'm pretty much back to where I was before I scrapped everything ... except with a much better understanding of what's going on with the code. I take that back. I'm ahead of where I was.
- I have a bucket that pours out a bunch of tiny balls.
- The tiny balls disappear when they hit ground (as they should).
- If the tiny balls hit their target, the target actually melts and then disappears if enough tiny balls hit it.
- I learned why "collision filters" are important and how to incorporate it into my code.
- I learned how to define various objects so that when they come in contact with one another, they do what they're supposed to do.
OH!!! I also built my "game" and ported it to my Android phone ... and the "game" works!! "Game" in quote because all that happens is: you touch the bucket and tiny balls fall out and hit their target and make it disappear. But I was very excited. Also found out that you have to port your .apk file (an Android app) to an actual web address to download it. I tried using Google Docs. I was able to download it to the phone using Google, but the phone was at a loss as to what to do with it. Now I have to figure out how to delete that file from my phone.
So, all in all, it was a pretty good week. I still have a long way to go, but the progress is good. Today I need to add multiple buckets (lives) that automatically pop back up after a bucket is used, need to add movable platforms back into the game (these divert the tiny balls), and also make the "game" able to restart itself at the end (right now after one bucket of tiny balls the game is just over and sits there).
Okay, maybe I won't get to all of that today. But it's certainly manageable by next weekend.
Subscribe to:
Comments (Atom)