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
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!
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.
another way to init variables that I use all the time:
Int OffsetX=0, OffsetY=0
string a$=""
Larry
Thanks Larry. I've adopted the prefix variable declaration and immediate value assignment for my programming in EB, like you posted. :)