|
rotate_angle problem |
Neil Black
Member #7,867
October 2006
|
I can't get rotate_angle to work! It compiles fine but when I run it the game crashes. Here's the code.
That's as far as I got, because rotate_sprite wouldn't work. When I take out the rotate_sprite statements, it doesn't crash. I just noticed I put a semi-colon on END_OF_MAIN(), but I don't think that's the problem.
|
gnolam
Member #2,030
March 2002
|
You're not checking if Ship was loaded successfully. Check it. I'm betting it's 1) failing 2) because Ship.bmp is in the wrong directory. Also, you need to itofix() those (Allegro) angles. But you shouldn't really store things in Allegro degrees anyway - use radians in floats/doubles and convert when passing the angle argument to rotate_sprite(). -- |
Neil Black
Member #7,867
October 2006
|
How do I convert, and how do I use itofix()? The bitmap is fine, it works with draw_sprite()
|
gnolam
Member #2,030
March 2002
|
Ok, in that case it's crashing because you're never actually calling Init_Stuff(). Quote: How do I convert The conversion factor to convert an angle in angle system 1 into angle system 2 is equal to the period for angle system 2 divided by the period for angle system 1. For radians -> allegro degrees, this is Quote: and how do I use itofix()? It's in the manual. [EDIT] -- |
Neil Black
Member #7,867
October 2006
|
How do I do error checking, and how do I destroy loaded and created bitmaps? Links to tutorials would be good.
|
gnolam
Member #2,030
March 2002
|
Possumdude0 said: How do I do error checking, and how do I destroy loaded and created bitmaps? Links to tutorials would be good. There are examples. There's a manual. There are even examples in the manual. Please read them. -- |
Neil Black
Member #7,867
October 2006
|
I don't know what to look for in the manual. I mean, now I know I could look up destroying bitmaps, but before I didn't even know I needed to do that. Then I figured you could easily point me to some information, since you seem to have some experience and know what you're talking about. But I guess I'll just sift through that huge manual for the tiny bit of information I need.
|
gnolam
Member #2,030
March 2002
|
I said: There are examples.
Possumdude0 said: Then I figured you could easily point me to some information, since you seem to have some experience and know what you're talking about.
I just did. At some point, you will have to start looking for information on your own. We can't spoon-feed you everything. -- |
Neil Black
Member #7,867
October 2006
|
Unless over-fishing kills off all his food, or he loses his fishing pole, or runs out of bait. Seriously, I just don't know enough to know what information to look for. I checked out destroy bitmap in the manual. Do I call it for every bitmap at the end of my program? Also, when you said look in the manual, I thought you meant that big long text document that came with allegro, I didn't know the manual here was sorted out with links and stuff for easy searching. I learn something new every day! Thanks.
|
gnolam
Member #2,030
March 2002
|
Quote: Also, when you said look in the manual, I thought you meant that big long text document that came with allegro You should also have a HTML version. -- |
Neil Black
Member #7,867
October 2006
|
I haven't seen one, but it may be in there somewhere, I'll look next time I can (sometime in the next 3 days, stupid work cutting into my slacking off time!) EDIT: Oh yeah, it's working now, too
|
|