IonicWind Software

IWBasic => Games and Graphics => Topic started by: definitelyokay on December 02, 2009, 06:59:36 PM

Title: Help with HGE
Post by: definitelyokay on December 02, 2009, 06:59:36 PM
I've been happily learning how to use HGE, thanks to fasecero's excellent resources.

However, I'm stumped on this particular demo program I'm making. Basically I have some pictures of some planets and I'd like to pan them around using the arrow keys.

But for some reason, it does everything but render! I think. I'm not exactly sure what's causing the problem, but you can find the complete program with it's resources in the attached zip.

I'd be much obliged if anyone can help! I'm pretty sure it's something simple I might be missing.

Joseph
Title: Re: Help with HGE
Post by: fasecero on December 04, 2009, 01:35:46 AM
Hi, JosephE. In the Frame function you don't give an initial value to the offsets, therefore, they will have random content, so just add something like:


Int OffsetX, OffsetY
OffsetX=0 : OffsetY=0


happy coding!
Title: Re: Help with HGE
Post by: definitelyokay on December 04, 2009, 08:45:52 AM
Having done as you said, and tweaked a few things, everything works great!

Somehow I assumed that EBasic cleared a variable out when it gave it to you, although I knew in languages like C and whatnot it would be garbage. Not sure how I came to that conclusion, but it definitely wasn't right.

Thanks so much for tracking that down! ;D I don't that I would have ever figured that one out.
Title: Re: Help with HGE
Post by: LarryMc on December 04, 2009, 09:05:47 AM
another way to init variables that I use all the time:

Int OffsetX=0, OffsetY=0
string a$=""


Larry

Title: Re: Help with HGE
Post by: definitelyokay on December 04, 2009, 11:07:42 AM
Thanks Larry. I've adopted the prefix variable declaration and immediate value assignment for my programming in EB, like you posted. :)