Image Animation Help

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2008
Posts: 7
Reputation: icedece is an unknown quantity at this point 
Solved Threads: 0
icedece icedece is offline Offline
Newbie Poster

Image Animation Help

 
0
  #1
May 13th, 2009
Hi guys

i'm currently creating a vb6 version of the arcade game "Stacker"
http://en.wikipedia.org/wiki/Stacker_(game)

The above link will give a detailed version of what i'm trying to create however for those who just want a rundown here it is:

There is a row of three cubes which move side to side on the screen, at the first row. When the player pushes the start/stop button, the row of squares will stop. Then, another row of three moving squares appears above the previous row, moving faster than the one before it. If the squares do not align directly above the previous set, any overhanging squares will be removed. If the player misses completely, the game is over. The number of available squares is automatically reduced to two, then one, during the game. The goal is to consistently get the squares directly above the previous set, "stacking" them to the minor prize and ultimately major prize levels.
In this case however the prizes will be replaced by points.


At the moment i'm having trouble figuring out the code for animation reversal when the blocks hit the side of the screen and change direction.


Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim Block(2) As BlockPart
  2.  
  3. 'Sets the initial value of the block
  4.  
  5. Private Sub Form_Load()
  6.  
  7. Dim i As Long
  8. length = 3
  9. For i = 0 To 2
  10. Block(i).X = (95 - 34 * i)
  11. Block(i).Y = 410
  12. ImgBlock(i).Left = Block(i).X
  13. ImgBlock(i).Top = Block(i).Y
  14. Block(i).Facing = 3
  15. Next i
  16.  
  17. End Sub
  18.  
  19.  
  20.  
  21. Private Sub TmrMove_Timer()
  22. Dim i As Integer 'counter
  23. For i = 0 To 2 'for each frame
  24. ImgBlock(i).Left = ImgBlock(i).Left + 10 'move it right 10
  25. Next i
  26. If ImgBlock(0).Left + ImgBlock(0).Width > ImgBackground.Width Then 'if at the edge of screen
  27. TmrMove.Enabled = False 'stop timer
  28. End If
  29. End Sub
  30.  
  31.  
  32. Private Sub CmdGo_Click()
  33.  
  34. TmrMove.Enabled = True 'enable the timer
  35.  
  36. End Sub

Any help here would be greatly appreciated
and thanks in advance
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 264 | Replies: 0
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC