Simple Animation with Visual Basic 2008


This is a simple and very cool animation with VB 2008 ***IMPORTANT*** To make this project work you need these two pics- a bat with its wings and an the other bat with its wings down. To get these pics go the following site img121.imageshack.us img5.imageshack.us After going to the link copy and paste the two pics into a directory (simply a place where u know it is like my pics) Public Clas frmMain Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Static x As Integer = 5 Static y As Integer = 0 Static flip As Boolean = False If y Mod 2 = 0 Then Me.PictureBox1.Image = My.Resources.bat1_a Else Me.PictureBox1.Image = My.Resources.bat1_b End If if Me.PictureBox1.Left (Greater Then Sign)= 500 Then x = -5 flip = True ElseIf Me.PictureBox1.Left (less Then Sign)= 0 Then x = 5 flip = False End If If flip = True Then Me.PictureBox1.Image.RotateFlip(RotateFlipType.RotateNoneFlipX) End If Me.PictureBox1.Left = Me.PictureBox1.Left + xy += 1 End Sub End Class The next vid that i will make will show how make the naimation move using the arrow keys 🙂

25 thoughts on “Simple Animation with Visual Basic 2008”

  1. @sueroski Yea yea whatever 😛 I did this in one take and kinda rushed because i had to do something important for school back then 😛

  2. hey. . what if i want to make the bat face the other direction. . i mean i want it to face and move from right to left. . how can i do that?

  3. @youwasted5secs It will, it just needs a little different code, very little, I know:vb6vb 2008vb 2010c# 2008c# 2010C++ 2008C++ 2010FoxPro 8FoxPro 9batchGame Makerand a few more languages

  4. @boolykbol Im using 2010 thanks anyway:phe just asked if it worked on 6but 6 and 2008/2010 are different. . different code styles. just to let him know:)

  5. To be honest i don’t know, I use vb 2008. I never tried vb 6. 0. Well if you want to give it a try on vb 6. 0, tell me if it works or not.

Leave a Reply

Your email address will not be published. Required fields are marked *