-
one more quick question
what equation do you use to work out the scale of the road strips. i get this unpleasing curve .
thanks howard
-
*********
this looks ace! just needs to stop the car from disappearing off the bottom of the screen on those high banked corners
-
Originally posted by howard54321
what equation do you use to work out the scale of the road strips. i get this unpleasing curve .
This is a chunk of road-generating code:
Code:
var roadbits = 70; // Number of strips
var roadCentreY = 128; // Position of screen centre
var roadCentreX = 160; // Position of screen centre
var roadAngle = 0; // Road curve
// Loop through all strips
for (var i = 0; i < roadbits; i++) {
// Attach road strip
_root.attachMovie('road', 'road_' + i, i);
// Create pointer to strip
obj = eval('_root.road_' + i);
// Set strip position
obj._x = roadCentreX;
obj._y = roadCentreY + ((i * i) / 27); // x^2 with a random constant
// Set strip scaling
obj._xscale = (5 + (obj._y - roadCentreY)) / 1.4; // Width of each strip is a function of its Y position with more random constants
// Set Y scaling of strips
if (i > 0) {
// Not first strip, so set scale based on previous strip
obj2 = eval('_root.road_' + (i - 1)); // Get pointer to previous strip
obj._yscale = (obj2._yscale + 0.8); // Set Y scaling
} else {
// Set first strip scaling
obj._yscale = 0.8;
}
// Set strip's starting frame
obj.gotoAndPlay(GetStartFrame(obj, roadbits - i));
}
As I said, there are a lot of magic numbers floating around in this code. This piece of code sets the initial values; during the game itself, the X and Y co-ordinates are set with these two lines:
Code:
// Position road horizontally
obj._x = roadCentreX + (((roadAngle / 2) * (roadbits - i)) / 12) - ((trackX * i * i) / 1000);
// Position road vertically
obj._y = roadCentreY + ((i * i) / 30) - (i * hillHeight);
Where trackX is the offset of the entire road, and hillHeight is the current elevation of the hill.
Last edited by ant512; 10-14-2004 at 05:08 PM.
-
Very nice.
I think it's great. Only a few suggestions I would make.
1- have the shine on the wheels move a little rapidly to simulate turning (see old retro racers)
2- have the car explode when it hits a sign and / or car
3- use the Three lights system with tones for the starting whistle
4- use the more generic "SPACE BAR" to accelerate.
5- Add brakes.
-
Senior Member
Re: Very nice.
Originally posted by Arne The Turtle
4- use the more generic "SPACE BAR" to accelerate.
You mean "UP"-key to accelerate...
-
Senior Member
WOW! The best racing engine for flash that I've ever seen. Nice work!
-
When you know are.
Nice work ant. My only complaint about the latest version is the tilting effect. I think the angle is a bit extreme as it is now, you should tune it down a bit if you haven't planned to do so already. I believe someone (me ) is liable to get motion sick playing it as it is.
-
Originally posted by Son of Bryce
My only complaint about the latest version is the tilting effect. I think the angle is a bit extreme as it is now, you should tune it down a bit if you haven't planned to do so already.
I intend to change the layout of the track to remove the more extreme corners - the whole thing is just one large multi-dimensional array, so that's quite easy. The tilt is so large at the moment purely for testing purposes. In fact, I might alter it so that the tilt and the angle of the road are independent.
Originally posted by Son of Bryce
1- have the shine on the wheels move a little rapidly to simulate turning (see old retro racers)
2- have the car explode when it hits a sign and / or car
3- use the Three lights system with tones for the starting whistle
4- use the more generic "SPACE BAR" to accelerate.
5- Add brakes.
1- I've been meaning to do this, but haven't got around to it yet;
2- Thought about adding that in, World Grand Prix-style, but the way your car exploded always annoyed me. I've gone for the Lotus 2 approach instead;
3- I've been meaning to do this too, but I might not actually put it in;
4- Good idea;
5- Brakes are currently the X key. Any suggestions which key I should use, assuming that Space is now accelerate?
-
Senior Member
How about UP for accelerate and DOWN for brakes? Then you only have to use one hand...
Love this game btw. I know some people didn't like the tilt but I loved it! I hope you keep it in It made the game more exciting.
-
Got around to adding some more to this, so here's the latest update:
http://ant.simianzombie.com/Road27.html
Updates are:
- Enemy cars now point in correct direction, finally;
- Gradient on road;
- Gradient on sky;
- Road speed calculated using a different method;
- Speedometer works properly;
- Speed indicator bar works properly;
- Timer works properly;
- World Grand Prix HUD bitmap removed;
- Some bugfixes.
Please let me know how this version performs on your hardware - I have a feeling that the gradient on the road might kill the performance on some machines.
-
Heli Attack!
Killer sweet, looks awesome.
Few things I would change... background rotating.. once you notice it, it really bugs you.
also, the rotating of the world should be decided by your speed.. if you stop on a curve, the world stays turned..
But overall, this thing is awesome!!!!!!!!
-
Script kiddie
I'm on a 450 Mhz G3 Mac, and the first file shown runs AMAZINGLY on my computer. Considering this is about as slowly as anyone here can experience the game, I'd have to say that's one freaking fast game you have there. Well done.
-
On keyboard controls....
Well, short of having a configuration menu, I'd suggest the following:
Left,J - Turn left
Right,L - Turn Right
Up, Space, A, I - Accelerate
Down, CTRL, Z, K - Brakes
Enter, ESC, Pause - Pause/Menu
-
Custom User Title
Yeah, its fast, but seems to me that is not real curves, at least not so real like those at that mario kart stuff, they look like simulation of curves, isnt it?
-
Originally posted by Increu
Yeah, its fast, but seems to me that is not real curves, at least not so real like those at that mario kart stuff, they look like simulation of curves, isnt it?
Umm... Well, no, they're not real curves. They're computer-generated lines designed to look like curves.
On the control front, I've gone with cursor control (up, down, left and right), plus Z and X as extra accelerate and brake keys. This means everyone can play it, regardless of keyboard layout, using one hand, and I can use my favourite emulator setup.
The next version will have sound, if I can figure out a way of generating enough engine samples without increasing the filesize too much. All sounds are, of course, pinched from the Amiga version of Lotus Turbo Challenge 2.
-
Untitled-1.fla
Very nice work you have there!
In some ways I like the very first test you posted best, because a) it runs super smooth, b) it is most "retro" and c) the road does not tilt. The latest version looks better, but the tilting of the road does not feel right somehow.
-
Originally posted by strille
Very nice work you have there!
In some ways I like the very first test you posted best, because a) it runs super smooth, b) it is most "retro" and c) the road does not tilt. The latest version looks better, but the tilting of the road does not feel right somehow.
The tilting thing does seem to have divided people. My current plan is to back-port all of the important changes to the original version, omitting the tilting and hills. This way I'll have the nice-looking and unusual latest version, the very retro original version, and the Sky Racer version.
-
the thud of the body
Looks good, but I'll agree with tonypa about perspective, cause it looks unnatural. And I'm against tilting as well...
-
This is the updated retro version:
http://ant.simianzombie.com/Road30Retro.html
It uses the graphics from the first version, and does not have tilting or hills. Everything else has been updated to match the latest version of the main codebase.
Other updates include:
- Basic samples added (these will change, as I've got the wrong ones from Lotus 2; also, the engine noise doesn't work properly yet - I might just remove it entirely)
- Some optimisation;
- Enemy cars appear more frequently.
This version runs much, much faster than the main codebase, as it doesn't have any pesky angles to calculate, has fewer objects on-screen at once, and is generally simpler.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|