Posted by Plaidman on March 27th, 2010
Today’s goal was to put some research into drawing graphics onto the screen. Basically, with the Android, there are three general methods to put stuff on the screen.
First, and simplest, is with the predefined Android view classes. This method allows us to put icons on the screen, and give the icons simple animations. This is good if we want to add some graphic flare to an otherwise boring app, but doesn’t allow much interaction.
In the second method, we override the onDraw() routine to fine-tune where things are placed on the screen, and call invalidate() method when we want to refresh the screen. This is good because you can tell the screen to refresh when WE want it to (like when you press a key to move a character) – it doesn’t take up much processing power, and we’re able to have more interaction with where things are on the screen. The downfall is the simple animations that are accessible in the predefined static screens aren’t available here. Since we’re updating the screen ourselves, we’ll need to control which image in a frame animation or which frame of a “tween” animation – translate, scale, pivot, etc – is shown. It’s a bit more work, but the trade off in interactivity is worth it.
The third method of screen drawing is the most processor intensive. It involves spawning a new processor thread that will handle screen drawing, while the original thread handles input and game logic. The “graphics thread” draws to a separate canvas based on data fed from the “logic thread” then it displays that canvas immediately when the drawing is finished, then starts drawing the next frame on a new canvas. This method produces a screen that is constantly being updated, so we can have very smooth animations for more graphically intensive games. The downfall with this is it is constantly drawing to the screen, so it’s more processor intensive and drains the battery faster. Also the same animation gotcha applies from above.
I played with all three of these before deciding that the second one would be best for my game.
Current demo: Using the third method above (though I ultimately decided to use the second after the demo was created), I defined my onDraw() routine to draw the image of a guy, we’ll call him Red, on a white screen at a specific location. The direction pad updated the location, which would be reflected when the screen redrew itself.
So basically a guy moves around a screen.
Posted in Android | 1 Comment »
Posted by Plaidman on March 26th, 2010
Finally, an excuse to update the site!
Lately I’ve been tinkering around with the development kit for my new phone. It’s an Android phone, if you didn’t deduce that from the title of this post. In the past few days I’ve just done some very basic form stuff, learning about layouts, XML view definitions, creating custom views, and interactions between “activities” which are basically sub-applications within an application package you’d download off the Marketplace, or what have you.
My first application, which will be on the Marketplace when I get around to signing up for a developer’s key, is a Dungeons and Dragons style dice rolling app, where you can type in a dice roll string (e.g. 2d10+4d6) and it will show you the rolls. I’m aware that this has “been done” and it’s not the most complex app, but I made it to learn, and it served its purpose.
My next project, which will be the new focus of this blog, will be much more interesting. Not the blog posts – those will be mostly nerdy stuff, but the final application should be fun. It’ll be a top down dungeon crawler – a roguelike, if you’re familiar with the genre. If you’re unfamiliar, think a simplified Zelda with randomized maps and items to provide infinite replayability.
As a side note, I will be cutting back on WoW to work on this more. Frankly, it’s more fun.
Posted in Android | No Comments »
Posted by Plaidman on January 6th, 2010
I’ve been thought-dumping on facebook lately. Take a gander! Old posts are hidden to non-friends but I think everyone who reads this is on my facebook list. Newer posts are open to the public.
Posted in Uncategorized | 2 Comments »
Posted by Plaidman on May 11th, 2009
In the interest of making at least one post every month, I suppose I owe you guys (does anybody read this anymore?) a post for May. No, February 2009 doesn’t count. Stop checking my date thing. STOP IT!
Washing Process
So, um, laundry. I think you first put the water in until it stops filling, then you wait for… No, that’s not it. You put the clothes in first and layer a capful of detergent between each half-foot of clothes like a parfait. The detergent is a clearish blue liquid, I think. I’m not quite sure what it’s made of so I’ve been using blue Kool Aid mixed with honey; that’s been working pretty well for the most part. When the clothes parfait is built, you can start filling the barrel with water. When that’s done, the washer goblins will come out and agitate the clothes by telling them inappropriate jokes and poking them with sticks. Don’t worry if the washer starts shaking violently, that means the goblins are playing capture the flag against the clothes, and that’s a good thing.
Drying Process
When the buzzer sounds on the washer, the final name-calling session has concluded and the clothes are ready to be thrown in the dryer. When you start the dryer, the clothes will tumble about gleefully in the warm air and hug each other tightly. Some people call this ’static cling’ but I call it ‘happy-tumble-time’. Clothes are mildly irritated by dryer sheets and will stop hugging if one is introduced in their happy-tumble-time. The warm air is pumped into the tumbler by the dryer goblins who stoke the furnace hidden beneath the dryer. They also keep track of time and periodically check the wetness depending on which setting you choose when you start the dryer.
A Note on Goblins
Contrary to popular belief, neither dryer goblins nor washer goblins eat socks nor use them as currency. If you’re missing one it’s likely still in the washer or dryer, or it’s fallen between the two as you were carrying them from one to the other. One last note: Make sure to do the washing process before the drying process. It’s not fun going to work in wet, agitated clothes.
Posted in Stuff I Forgot | 3 Comments »
Posted by Plaidman on April 5th, 2009
I was discussing computery things with the coolest Coloradoan chick I know, and I was reminded of an old football game I wrote for the TI-89 graphing calculator in high school. Here’s a link. Apparently it was pretty popular – it’s gotten nearly 10,000 downloads from the site.
I started it on a car trip to North Carolina for a family Christmas trip and continued working on it for a couple months afterward. Reading the documentation brings a tear of nostalgia to my eye. Especially the thank yous, wherein I thank RHCP for their kick-ass programming music. I had great taste in music back then, didn’t I?
If you have any bugs to report, questions, suggestions, or you just
want to say 'good job' or 'this game sucks', you can email me at
jester323@ignmail.com.
Posted in Uncategorized | No Comments »
Posted by Plaidman on March 14th, 2009
I was tossing my freshly washed clothes into the dryer yesterday and I noticed a peculiar setting for the automatic dryness sensor: OPTIMUM DRY. I’ve always kept the dryer at this setting, but I never pondered the terminology. Really, anything other than optimal dryness would be sub-optimal. Who wants anything suboptimal when optimal is an option? In my mind, the other options might as well be still wet and burnt to a crisp. Claiming to be optimum is quite a tall order, but my dryer delivers; I’ve never pulled a moist or charred piece of clothing out. The only way my dryer could be more optimum is by folding the clothes when it’s done. When that happens, I’m gonna start buying guns, ’cause there’s some Terminator shit goin’ down.
Along with Optimum, there’s More Dry, Less Dry and Fluff. There’s also timed-dry for when you’re on some kind of laundry-time budget. Those settings are for laundry noobs. Give me Optimum or give me a new dryer, I’ve always said! Actually, this is the first time I said it, but I’ll probably say it again soon.
I’m still searching for a stove/oven with an optimum deliciousness setting.
Posted in Uncategorized | No Comments »
Posted by Plaidman on March 2nd, 2009
Jim: i haven’t gone grocery shopping in awhile
Jim: my grandma sent some catfood for Valentine’s Day
Jim: and I’m hungry
Jim: do the math, and you will arrive at what I’m seriously doing right now
Me: grocery shopping?
Jim: no
Fortunately, his grandma feeds her cat tuna.
Posted in Uncategorized | 2 Comments »
Posted by Plaidman on January 27th, 2009
I did. Just today.
When I hung up the phone, I felt liberated. A weight has been lifted from my shoulders to the tune of a grand per year. I can’t believe I’ve been paying that much for something I use so little.
I’ve been watching most of my TV through Hulu and Torrents lately, so this shouldn’t affect my day-to-day too awfully much. I like to fall asleep to Discovery or Conan, but I think I can learn how to use my clock radio for that.
Hmm, what else can I find that I don’t use often? Anybody want to buy a Wii?
Posted in Uncategorized | No Comments »
Posted by Plaidman on December 19th, 2008
Here’s a haiku to apologize for the lack of activity recently.
I love this snow verily
I drive through it so merrily
It shouldn’t be distributed so sparingly
Ok, so it’s not a haiku, I don’t care. Have a happy Christmas and a merry New Year!
Posted in Uncategorized | 1 Comment »
Posted by Plaidman on November 6th, 2008
AC/DC is the most energetic live show I’ve ever heard of.
Here’s some pictures of the show.
Posted in Uncategorized | 1 Comment »