The sub-routine here is one I'm using to create a Hardware Image - (,33) type -
SUB InitParams
(X00Step!
, Y00Step!
, O00Step!
, O10Step!
, Mega!
, X00!
, Omega00!
, Y00!
, Omega10!
) Temp&
= _NEWIMAGE(2 * HalfWidth%
+ 1, 2 * HalfHeight%
+ 1, 32) _PUTIMAGE (BoltX%
- Parameters!
(GameLevel%%
, 1), BoltY%
- Parameters!
(GameLevel%%
, 1))-(BoltX%
+ Parameters!
(GameLevel%%
, 1), BoltY%
+ Parameters!
(GameLevel%%
, 1)), Targ&
Quacker& = HardwareImage&(Temp&)
X00Step! = (Parameters!(GameLevel%%, 7) - Parameters!(GameLevel%%, 8)) / (15 * FrameRate%)
Y00Step! = (Parameters!(GameLevel%%, 11) - Parameters!(GameLevel%%, 12)) / (15 * FrameRate%)
O00Step! = (Parameters!(GameLevel%%, 9) - Parameters!(GameLevel%%, 10)) / (30 * FrameRate%)
O10Step! = (Parameters!(GameLevel%%, 13) - Parameters!(GameLevel%%, 14)) / (30 * FrameRate%)
Mega! = Parameters!(GameLevel%%, 0) / (DuckRad% + HalfHeight%)
X00!
= (Parameters!
(GameLevel%%
, 7) - Parameters!
(GameLevel%%
, 8)) * RND + Parameters!
(GameLevel%%
, 8) Omega00!
= (Parameters!
(GameLevel%%
, 9) - Parameters!
(GameLevel%%
, 10)) * RND + Parameters!
(GameLevel%%
, 10) Y00!
= (Parameters!
(GameLevel%%
, 11) - Parameters!
(GameLevel%%
, 12)) * RND + Parameters!
(GameLevel%%
, 12) Omega10!
= (Parameters!
(GameLevel%%
, 13) - Parameters!
(GameLevel%%
, 14)) * RND + Parameters!
(GameLevel%%
, 14)
The image used in the program is "Quacker&" and is formed by placing a loaded image "pigeon.png", and then placing on top of it the image "Targ&". The subroutine (not given here) "HardwareImage&()" converts the image into (,33) type.
Amazingly, sometimes the image is missing the "Targ&" overlay, and sometimes the image is correctly shown with the "pigeon.png" image and the "Targ&" image on top.
This instability occurred when I copied the program into an InForm .bas file and did not (I'm fairly certain) have any problems previously. To my inspection, there seems nothing wrong with the code (but what do I know???).
Any suggestions? I haven't supplied the image "pigeon.png", and I hope that you may be able to do this by inspection.