hiya - i'm making a new game and want to know how to make a simple rounded race track. i've done everything else but want to know what to use.
I've tried g.fillRoundRect(left.x,left.y,left.width,left.height,left.arcWidth,left.arcHeight);
but an error pops up
can anyone help - i want to make a simple race track like this one.

Recommended Answers

All 11 Replies

Why not g.fillOval()?

Also, will repainting be an issue? How much detail will be displayed on your screen? Are you at all using images?

A lot of questions come to mind since this seems like an interesting project.

Everything is ready- just got the track to do, is using g.fillOval() better than fillRoundRect? there will be a fair amount of graphics used.

There are a lot of questions...

First, will resizing the screen be an issue at all? If not then you could make a custom track using GeneralPath and Graphics2D fairly easily.

You could do so even with resizing but it would be a bit harder.

What error are you getting when you use g.fillRoundRect() ?

The list goes on =P

with g.fillRoundRect() i can't seem to finish the last 2 options as an error pops up like this g.fillRoundRect(left.x,left.y,left.width,left.height,left.arcWidth,left.arcHeight); these last two areas i don't know how to complete. plus resizing the screen won't be an issue thank u. I want to make it through java in eclipse.

These two parameter define if you are getting circle or oval/ellipse shape. So if the width and height are equal you drawing circle, if they are of different size you get oval. More on topic can be found at Sun tutorial: Working with Geometry

yes but have u got any idea how to make a race track the shape i've given on top if so tell me how

If you bothered to read the link he posted, in Drawing Geometric Primitives, they discuss the rounded rectangle and oval both.

tried it - didn't work, still missing something

Please post your coding, reading from magic ball is special skill non of us have ;)

YES!!! - finally did it, got the track/game i needed. all is done now. thanks to those who tried to help anywayz.

" tried to help anywayz." ?
Odd way of thanking those who gave you information based upon your less-than-precise posts. If by "tried to" you mean "didn't write the code for you", then perhaps you misunderstood their intent.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.