Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Visual Basic 2008 - Simple Animation

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
9,530
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 25, 2009

*****WATCH IN HQ*****

In this tut we will go over animation!

I got to the part where i debug it to show u how
it looks and sudenly something blocked and i had
to build it all over so these are 2 clips together.

You can follow tutorial or download project:
http://www.mediafire.com/?jnnuyjqngj0

So first make basic form , put one button
and let it say "Start" or whatever.

Then put 4 timers , set intervals to them to be
about 25 , and let them be enabled = false,put
5 pictureboxes like in video.Name the one red
enemy.

Now code for the button "Start" is
timer1.enabled = true

That means it will start the first timer
NOw code for timer1:
enemy.top = 2 ' this will increase enemy top by 2 that means it will
' move down
if enemy.top = picturebox2.top then ' if the enemy top is equal or higher
' than picturebox2 top
timer1.enabled = false ' the timer1 will stop
timer2.enabled = true ' and timer2 will start
end if

Code for timer2:
enemy.left = 2 ' enemy left will increase by 2 that means
' it will move right
if enemy.left = picturebox3.left then ' if enemy top is equal or higher
' than pbox3 left
timer2.enabled = false ' timer2 will stop
timer3.enabled = true ' timer3 will start
end if

Code for timer3:

enemy.top -= 2 ' enemy will move up
if enemy.top = picturebox4.top then ' if enemy top is equal or less
timer3.enabled = false ' timer3 will stop
timer4.enabled = true ' timer4 will start
end if

Code for timer4:

enemy.left -= 2 ' enemy will go left
if enemy.left = picturebox1.left then ' if enemy left is equal or less
timer4.enabled = false ' timer4 will stop
timer1.enabled = true ' timer1 will start
end if

and basicaly all that is an infinite loop , enemy will
always sircle around in your form , dancing! :)

Subscribe,rate,comment

Video Size: 92.8 MB

*********************

Link to this comment:

Share to:

Uploader Comments (Surowithekiller)

  • you made this video with sony vegas pro ???

  • yes

  • Your Videos are nice

  • tnx

  • I found a Bug. If Timer4.Enabled = True and you click on start the picturebox go diagonal throug the form and if the picture box is at the bottom left then there is a error with picture but not with this programm but with the picturrebox(enemy)

  • download project from description , there is no bug

Top Comments

  • @krechlich Hm... You mean actually move your mouse or the gun?

see all

All Comments (32)

Sign In or Sign Up now to post a comment!
  • why u not type the button1 code only Timer1.Start() ????

  • What song is that?

  • nice!

    btw what resolution do you record in?

  • Hey man, im doing a game where you can shoot with sniper, but how can i set my cursor to move like 5 cm above when i press mouse. Shortly explained: how can i do recoil. And if you know or someone else, how to make the cursos come also back slowly to the spot where i shooted. Thanks for help!!!. Btw your tutorial was awesome

  • best tutorial about visual basic 2008 in whole youtube.

  • any link?

  • I know a way to make it only need 1 timer and 1 box

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more