In this tutorial I am going to take you through some animation basics. Before we start, I want to be clear - this will get complex quickly as we are essentially building video games as opposed to drawing a few simple images. I will note also that to get the best graphic results you need a gaming style machine with excellent graphics capabilities. My laptop is quite limited by a slow refresh rate for instance.
My methodology here will be to provide a series of "games", each with a brief descriptor. The games will be stripped of a lot of code that we normally use to help you focus on what is new. The games will build incrementally on each other at times to show you the basics of animation.
Game 1
In this game you will simply be able to move a cursor around a screen with your mouse. Hit space bar to exit the game.
Game 2
In this game you will simply be able to move a cursor around a screen with your mouse. Here, flip is modified so you can see your path. You will note there are gaps if you move quickly - think about why this is. It is actually a challenging problem to solve this. Why is this? It takes time to draw and while you are drawing people are still moving. Note if you move slow enough then you see a continuous line. If you move fast, you do not. Hit space bar to exit the game.
Game 3
This game is one fix for the above problem but it is not great, it turns the mouse into a steering wheel essentially. Try it out and look and see what it is doing differently. Note, this would work a lot better with keyboard control or ideally a Gamepad.
Game 4
This game is the same as those above but it switches to keyboard control.
Game 5
Missile Launcher. I have written this to give you some idea about complex graphics and simple animation. At the end of the day, professional game companies have loads of people on staff who are simply responsible for programming graphics - from how much code you need to just do this you will see why. Further, a lot of professional graphics people use predesigned packages to speed up graphics programming. In a sense, PSYCHTOOLBOX does just that but the ones I am referring to are far more sophisticated.
My methodology here will be to provide a series of "games", each with a brief descriptor. The games will be stripped of a lot of code that we normally use to help you focus on what is new. The games will build incrementally on each other at times to show you the basics of animation.
Game 1
In this game you will simply be able to move a cursor around a screen with your mouse. Hit space bar to exit the game.
Game 2
In this game you will simply be able to move a cursor around a screen with your mouse. Here, flip is modified so you can see your path. You will note there are gaps if you move quickly - think about why this is. It is actually a challenging problem to solve this. Why is this? It takes time to draw and while you are drawing people are still moving. Note if you move slow enough then you see a continuous line. If you move fast, you do not. Hit space bar to exit the game.
Game 3
This game is one fix for the above problem but it is not great, it turns the mouse into a steering wheel essentially. Try it out and look and see what it is doing differently. Note, this would work a lot better with keyboard control or ideally a Gamepad.
Game 4
This game is the same as those above but it switches to keyboard control.
Game 5
Missile Launcher. I have written this to give you some idea about complex graphics and simple animation. At the end of the day, professional game companies have loads of people on staff who are simply responsible for programming graphics - from how much code you need to just do this you will see why. Further, a lot of professional graphics people use predesigned packages to speed up graphics programming. In a sense, PSYCHTOOLBOX does just that but the ones I am referring to are far more sophisticated.