Space Invaders using Flexgrids

rataf
rataf used Ask the Experts™
on
I would like to know how it is possible to get an image of a spaceship to be able to move across the bottom row of the flexgrid and fire an image of a bullet upwards. Thank you...
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Here's the bottom scroll of the picture.  This would be a good start.


Private Sub Command1_Click()
    With MSFlexGrid1
        .Row = .Rows - 1
        .Col = 1
        Set .CellPicture = LoadPicture("c:\rocket.bmp")
       
       

    End With
End Sub

Private Sub Timer1_Timer()
    Static lCol As Long
    With MSFlexGrid1
        .Row = .Rows - 1
       
        lCol = lCol + 1
        If lCol > .Cols - 1 Then
           
            .Col = .Cols - 1
            Set .CellPicture = LoadPicture("")
            lCol = .FixedCols
           
        End If
       
       
        If lCol > .FixedCols Then
            .Col = lCol - 1
            Set .CellPicture = LoadPicture("")
           
        End If
        .Col = lCol
        Set .CellPicture = LoadPicture("c:\rocket.bmp")
       
    End With
End Sub
I hope this is more for entertainment than to produce a game.  There are probably better ways of making a game like this than using the grid.

Commented:
I agree.  Grids are not designed for animations.

If you want a starting point, you can look at a project that I had on of my students work on as a class project:

http://www.sdplug.com/projects.htm
"Space Invading Aliens"
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- points to twalgrave
Please leave any comments here within the
next seven days.
answer force-accepted

DigitalXtreme
CS Moderator

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial