Folow The Dots Game
Author |
Message |
Carey
|
Posted: Tue Apr 11, 2006 9:38 am Post subject: Folow The Dots Game |
|
|
This is my prototype program. It has no timer yet, but I will work on that. Enjoy!! If you have any sugestions please post them.
Carey
Description: |
A game where you follow the dots to get to the end. |
|
Download |
Filename: |
DotGame.t |
Filesize: |
2.95 KB |
Downloaded: |
228 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
MysticVegeta
|
Posted: Tue Apr 11, 2006 5:20 pm Post subject: (No subject) |
|
|
nice... well used loops structures and good interaction of user and game! I would just say that instead of using quit why not make the option so that the user can restart.
|
|
|
|
|
|
Delos
|
Posted: Wed Apr 12, 2006 7:55 am Post subject: (No subject) |
|
|
Melikes. It's simple and clean, functional and not overbearing. Here's some comments on the code:
code: |
var x : int
var y : int
var lastx : int
var lasty : int
|
Instances like these when various variables are related and basically describe the same object call for the use of types and records.
code: |
type ball:
record
x, y : int
lastx, lasty : int
end record
var test : ball
test.x := 10
|
Check out the [Turing Walkthrough] for links to the relevant tuts.
Can be written as:
code: |
y += 10
% Similarly, you could have
y -= 5
|
Your generative algorithm is quite simple, but good work on coding it. What you'll want to do now is optimize it so that you don't run into the problem of the trail hitting the walls and ending prematurely.
And easy way around that is to include a condition that checks to see if it is currently next to a wall, and in which case would limit the directions it could grow in (instead of simply exitting when it gets past a wall).
Additionally, you could work along the idea that your trail will start in once position and end in another (predefined) position - and your algorithm will calculate a randomized path between the points. It's actually not as difficult as it sounds. A working analogy would be: if you wanted to produce a set of 10 numbers whose average would be five, you could have 9 of those numbers being anything you want, but the 10th would have to offset the rest of them to achieve that average.
Same line of thought - your blocks can go in any direction, just so long as the last one ends up getting to the destination.
Good work and +bits.
|
|
|
|
|
|
NikG
|
Posted: Wed Apr 12, 2006 8:10 am Post subject: (No subject) |
|
|
Good job! It's an interesting game.
Found 2 problems though (1 major, 1 minor):
Looking at your code, I noticed that the program stops drawing dots once x < 20 or x > 625 or y < 20 or y > 375. The problem with exiting this way is you will not always get the number of dots you want (100 + (level * 10)).
Secondly, I noticed a delay once I stepped on the blue square before it finally realized I had won. Obviously, this is because of your 2 for loops that check if the there are any yellow dots left.
I'm not too sure about how to fix the first problem easily. The second can be fixed (or at least the time can be shortened) by using an array while keeping track of where the max and min y as well as the max x circles are.
Edit: looks like Delios beat my post just by a few minutes...
|
|
|
|
|
|
|
|