Yeah ... I didn't get any other work done last night. I did polish my Asteroids program for turn in today. I'm not particularly satisfied with what I had to do, but it works. I had to add a few functions to clean some of the code, but I don't think it makes too much sense to have those functions. Oh well. Also, I distrust void pointers. So far, it looks to be the worst Asteroids game ever. I doubt I'll have any time to fix that before the due date next week, because next week is filled with MS work.
Hopefully I'll get my week3 done Friday for MS. Saturday will be more Asteroids. Then I'll start work on the MS final Sunday. Monday: I hope to finish the MS final. Tuesday: Asteroids. Wednesday: week4. Thursday: Asteroids. Friday: finish week4. Saturday: finish Asteroids. Hopefully the SGD final doesn't suck too bad; I won't have any time to study for it. Though I pretty much know everything we've covered. It's not that bad.
***
Next life for cell phones. I think it's a dumb idea. For one, I'd rather not make a phone call everytime I tried to buy things. That'll cost a minute or two on my phone. Granted, I've got a million rape minutes left to use. And when they make it so you can wave the phone across a pad to charge, that'll be asking cell phones to get stolen. Let's pretend you wave the phone and then also sign the receipt, isn't that just a credit card? Yes. Yes it is. Currently the two billing options are: pay up front and use it like a debit card or every charge goes against your credit card. I always have my wallet on me; most of the time I have my cell phone. Often, my cell phone falls out of its belt holder. And more often, the belt holder slides off and falls into the car seat. One of these days I'll actually get around to making a leg holster for it. The problem is I need time and style. I could just wrap my bandana around my leg and clip the belt holder to it, but that would look really really bad.
***
Del doesn't have a cell phone, so he's using Chill's number on all his applications. This may or may not be good in the long run, but we did find out that Del is turning in his applications. He received a phone call from Dollar Tree an hour ago. Of course, he's not home; he's out applying to other stores. But this is good news.
***
What was Willis talking about?
3 Comments:
Distrusting void pointers is a good thing, but they can be useful. You just have to carefully inspect any code that's using them to be sure you know for sure what you're retrieving from the pointer. Safest way to use them is to encapsulate their use in a class so that you can minimize the places where it's actually used as a void*.
But now I'm sounding more like a coding instructor.
And, yeah, maybe you woke up Del. That's a good thing.
So we found out that void double pointers are even funner to play with. I find it a bit nonsensical what we have to do to our program, but it might make sense. Our Asteroids game has an object manager. Basically it has a list and we tell it what to fill it with. Add an asteroid. Add a bullet. Then we add a messaging system to the game. Tell it to tell the object manager what to do. Now we've added a memory manager so the object manager has to tell it to allocate memory. The object manager now holds pointers to the memory in the other arrays. And it's insane!
Since you have an object manager, you'd probably really want it to have pointers to some base class (like "GameObject" or "DisplayedObject"). Then derive "Asteroid", "Ship", and "Bullet" from that base class. A virtual method could then be used to display the object, and a base class method (or binary operation) could check for collisions.
But they probably wanted to have you do an exercise where you use void pointers and memory management so you understood the techniques, rather than do a stricter object-oriented design. In a lot of cases you want to do some of that kind of thing for speed in real-time apps like games (though probably not a big deal for Asteroids).
Post a Comment
<< Home