Game Graphics w/ Scrolling Background

willisgt

Active Member
Licensed User
I've just started playing with building a game app. I need to include a scrolling background - think vintage arcade games like Defender or Lunar Lander.

I also need to draw game graphics in the foreground.

So far, the scrolling background works great. The foreground graphics also work great. The problem is that my background is an image control; if it's visible, then the foreground graphics are hidden.

So I'm guessing that an image control lays over the form, and whatever's on the form gets hidden by the image, whether I draw of the form's ForeLayer or not. True?

My apologies for regressing back to 'beginner' status on this one - I haven't yet had much opportunity to explore the graphic functions.


Gary
 

hung

Active Member
Licensed User
Longtime User
why not use drawer from imagelib to draw the background then drawer to draw your object in front.

e.g.
' background
drawer_draw2("bmpbg", mapwin.x, mapwin.y, mapwin.w, mapwin.h, 0,0, false)
' then object1
drawer_draw2("bmp1", 0,0,bmp1.Width,bmp1.Height, ptc.x,ptc.y, true)
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Gary
In addition, make sure not to miss out the sprite.dll library.
 

willisgt

Active Member
Licensed User
Thanks, gentlemen - I've actually made some progress on this. See this link: http://www.b4x.com/forum/showthread.php?t=2027

I am actually using an approach similar to what was suggested; the Sprite library, while extremely cool, will not work for this application.

Gary
 
Top