Programming the GP2X – Part 3: Mistakes Were Made

Tank game prototype on gp2xWell, I had not one, but two big mistakes in my code to calculate the trajectory of the bullets:

1) I had my GRAVITY constant defined as a negative (-9.8 m/sec^2), then I was subtracting it instead of adding it – so the bullet rose faster and faster!

2) The sin() and cos() functions were expecting angles in radians, and I was passing in degrees. That’s why everything got all crazy when I used an angle above 70.

    These are both resolved now, so the bullets actually go from here to there now. I can start doing some code cleanup before I move on to actually creating the explosions.

Programming the GP2X – Part 2

I got my prototype game running on the GP2X last night. There’s still something wrong with the projectile trajectory, but it was very cool to compile the program on my PC and then copy it over and see it run on the small screen.

If you’re getting into GP2X development, definitely check out the GP2X Dev Wiki, especially the section on setting up a development environment. I followed the instructions for Windows and everything worked perfectly.

I’m still not very happy with DevC++ as an environment though. I looked at CodeBlocks and didn’t like it. Eclipse looks promising but very complicated. I may just end up going with Visual Studio since that’s the environment I know best.

Programming the GP2X

Atari Adventure on the GP2XSo I ordered a GP2X last week. It’s a linux-based handheld that’s completely open for development.

If you are into emulation and classic games this is the system for you. It runs lots of emulators, MAME, etc. It also supports DivX and Xvid .avi playback.

Sean and I have decided (again) to try to write a game and Jim is on board for the art. I spent the weekend just trying to get acquainted with the system and rough out a Scorched Earth clone. I figured it is simple, but still has things like a HUD, physics, and so on.

Well, the first thing I learned is that I don’t know nearly as much about C++ as I thought. I’ve been coding C# for several years but it has tons of featured that just plain don’t exist in C++. So there was lots and lots of Googling and research.

So far I’ve got drawing both tanks on the screen, reading the input for the trajectory and power of the shot, and displaying that on the screen. Something’s funky when shot is actually fired though. I’m not sure if it’s not registering the input or if my math is way off.

Which brings me to my next issue: the debugger in DevC++ kind of sucks. I’m going to look into getting a different IDE set up, maybe CodeBlocks or Eclipse. Any suggestions?

Satellite Sighting

Saturday night Srini and I were checking out Mars and Saturn. They were very close in the sky – but unfortunately not close enough to take a picture (the NexImage field of view is quite small, about the same as a 5mm eyepiece).

I decided to sketch what I saw instead, and look up the moon positions and star names later. I looked back and forth between my sketch and the eyepiece several times and suddenly saw something whiz by Saturn. I turned to my laptop, which was running Starry Night at the time, and wound it back to confirm what I thought – yep, it was a satellite.

If I’m reading the Heavens Above database correctly, it is the rocket body of Cosmos 1484, a Soviet satellite used for “Gathering regular information on the natural resources of the earth for use in various branches of the Soviet economy, and conducting further tests on new types of measuring apparatus and methods of remote sensing of the earth’s surface and atmosphere”.

It didn’t really look like anything since it went by so fast, but it is pretty damn cool that I was looking through the eyepiece right at the split-second it passed by (especially since I wasn’t expecting it).

If you have Starry Night, you can download this file to see what I saw. If you’re into astronomy and don’t have Starry Night, get it!

Mmm, del.icio.us…

This weekend I got annoyed looking for bookmarks that are on my work machine, my desktop, my laptop, etc and started looking for a bookmark manager that would spare me the hassle of keeping an html page updated.

I know del.icio.us has been around for a while, but to be honest I never looked at it, and in fact I thought it was something like digg(which is cool, but not what I was looking for in this case.

del.icio.us is kind of like flickr for bookmarks. You can tag your bookmarks in whatever ways make sense to you, and you end up with a page with a nice URL that’s easy to remember. You can share your bookmarks if you want (mine are at http://del.icio.us/yacullo)and create a “network” of your friends’ bookmarks. You can also search other people’s booksmarks, see what has been added recently, what is under what tags and so on.

If you give this a try, I highly recommend the FireFox extension which adds a “Tag this” button to your main toolbar.

Now I’ve got all my bookmarks whereever I go and I’m happy.

Frazetta Close Up

The BarbarianOn Saturday Jim and I drove out to East Stroudsburg PA to visit the Frank Frazetta museum.

Frazetta’s been a favorite of mine since I was a kid. I don’t remember when I first became aware of him, but I do vividly remember begging my mom to let me buy “The Fantastic Art of Frank Frazetta” when I was fairly young.

I never realized there was a Frazetta museum until a few months ago when I finally got around to watching Painting With Fire, the Frazetta documentary, which mentioned it in passing. I immediately said, “OK, I’m going!” The museum is curated and managed by Frank’s wife Ellie. Although we were disappointed not to meet the man himself, she took the time to meet each visitor personally and told some interesting and funny stories about some of the paintings.

Frank Frazetta MuseumThe museum is quite small (this image shows about 75% of it) but it’s an inspiring sight. To stand in front of a single Frazetta painting from only a foot away is fantastic, and to see them all at once is almost overwhelming. It was hard to keep from running all over the place going “There’s that one! Ooo there’s that one!” Although I have several books of his work, I was surprised to see how much detail is not reproduced in print. The makeup on the Egyptian Queen, the scars on Conan’s face, were so incredible.

As sort of a funny side note, seeing all these paintings in one place made me realize something: Frazetta doesn’t draw feet! I forget at what point it dawned on us, but as we moved from painting to painting we started to laugh, “Yep, no feet on that one either!” Of course there are some that have feet, and they are certainly well-rendered (so it’s not like he can’t draw feet obviously) but time after time the feet were hidden behind trees, under water, buried in snow, in stirrups, obscured by piles of bodies, etc. Take a look at a bunch of his paintings and you’ll see what I mean!

Anyhow, the museum is open Saturdays and Sundays. If you are a fan and in any way able to make it out there, take the trip and you won’t regret it.

Just Call Me Hubble

Bigger SaturnHere’s my latest try at Saturn. The moon and Saturn were close in the sky last night (but alas, not close enough to get a picture of them together). I was trying out my new barlow lens, and as you can see is compatible with my scope. Whew.

I also tried for a picture of the entire moon but I’m having some trouble with the image reducer and / or it doesn’t work the way I think it does. Ah what would astronomy be without gear problems?

Speaking of astronomy, allow me to be the first to congratulate it on being promoted from a subcategory of Tech and a Burning Interest to a full-on category here at Planet of the Geeks. Good job, Astronomy, we knew you could do it!