There are two sections here for behind the scenes:
This is for Mr Sabaretnam. How I made the webpage.
BrickWarrior is mostly developed at my (Chris's) home on my PC, using Microsoft Visual C++ version 5. Here is a screenshot of my computer screen while working on some of the source code:
How do the balls move??? NOTE: Only read on if you are INTERESTED! It's pretty nerdy! Alright, here is the way animating things works: show a picture on the screen, then show another picture, with a bit of a change between each one, and things in it appear to move. If you have ever used a flick book, you'll know what I mean. In BrickWarrior, there are usually 60 of these pictures (called frames) each second (if your computer is reasonably fast - Phillip Shaw gets about 20 frames a second) and the ball is moved a bit each frame, so that it looks like the ball is moving smoothly. The ball has two components for its velocity (remember in physics?) which are the X-component (left and right) and the Y-component (up and down).
There are two variables in the programming to represent the X and Y components of the balls velocity. For the X-component, a positive value represents going to the right, and a negative value represents going left. For the Y-component, a positive value means the ball is going down, and a negative value means going up. The two variables are in pixels per second. Example: If the X-component was 100 pixels per second and the Y-component was -100 pixels per second, the ball would be going down and to the right, at 141 pixels per second, as shown here:
The velocity is measured in pixels per sec (or pixels/second), and if you multiply it by how many seconds the ball has been moving for, you get a result in pixels. Example: 300 pixels per second * 0.5 seconds = 150 pixels 300 * p / s * 0.5 * s = 150 * p Notice how the PER SECOND and the SECONDS, when multiplied, cancel each other out. Anyway, when you get your value of 150, this is how far the ball has moved, and this value is added to the balls previous position to get its new position. Here is a screenshot of the code which actually does this in BrickWarrior: (please note that I changed it a bit to make it more readable)
|
[Home]
[What is
BrickWarrior?]-[How do you play?]
[Behind the scenes]-[Credits]
[Levels]-[Powerups]
[Downloads]-[MacBrickout]
Site design Chris Hulbert 1998