Computer Science Canada car racing game with moving background |
Author: | ceraf [ Tue Oct 26, 2004 9:44 pm ] |
Post subject: | car racing game with moving background |
I made a 2-player car racing game using only circuit tracks (due to image resolution limit). Since I want to add larger tracks, the only way to accomodate it is to use the moving background method. I've already tried taking some code from the Space Game, but it was a complete failure. Anyone know how to do this? |
Author: | Delos [ Wed Oct 27, 2004 10:16 am ] |
Post subject: | |
Larger maps? You might want to look into View.UpdateArea(). I'm not sure if this answers your question though. View.UpdateArea() will only refresh a bit of the screen, so speed the programme up if you know exactly which areas need updating and which don't. Generally, this allows for the use of larger images w/ anim. |
Author: | ceraf [ Wed Oct 27, 2004 12:08 pm ] | ||
Post subject: | |||
View.UpdateArea()? I can't seem to find that command. What version of Turing is it? I am using 4.0.4c. For those who don't want to bother downloading a zip file, here's the code:
|
Author: | wtd [ Wed Oct 27, 2004 2:27 pm ] | ||||
Post subject: | |||||
A few thoughts.
|
Author: | Tony [ Wed Oct 27, 2004 2:28 pm ] |
Post subject: | |
ceraf wrote: What version of Turing is it? I am using 4.0.4c.
Time to upgrade yourself to 4.0.5 ![]() |
Author: | ceraf [ Wed Oct 27, 2004 5:39 pm ] |
Post subject: | |
Quote: Use meaningful variable names. What does "carslo" mean? If I don't know, how can I help you with your code?
Sorry about that. I haven't developed the habit of writing in sudocode to explain things. I'm also very bad at giving variable names. The car position are x and y, and the second car position are x1 and y1. To my knowledge, those are the only variables that are necessary for moving a background, unless you need to add more for the map position too. (Btw, "carslo" is how quick the car decelerates or slows down.) Quote: Learn about records. There are tutorials here. You can use them to dramatically cut down the number of variables you have hanging around.
Quote: Use procedures and functions not just to handle the graphics of the program, but also to handle the logic of the program as well.
Wow...those are really useful. Too bad I only have a limited amount of knowledge on Turing. And now I'm starting to learn VB in class, and I'll get really confused. Quote: Time to upgrade yourself to 4.0.5
Only if i could. The way my school computers work, you can't update anything. Only administrators can. ![]() |
Author: | wtd [ Wed Oct 27, 2004 8:32 pm ] |
Post subject: | |
ceraf wrote: Quote: Learn about records. There are tutorials here. You can use them to dramatically cut down the number of variables you have hanging around.
Quote: Use procedures and functions not just to handle the graphics of the program, but also to handle the logic of the program as well.
Wow...those are really useful. Too bad I only have a limited amount of knowledge on Turing. And now I'm starting to learn VB in class, and I'll get really confused. I wouldn't worry about it too much. The concepts will serve you very well in almost any programming language you learn, and Turing is relatively easy to learn them in, compared to some languages. You have to learn them sometime. Better to learn them now than to continue doing things in a "wrong" way and then have to unlearn those wrong ways. ![]() |