Ha, a lot of people have been saying the same thing! I'll change it in the new version, but that won't be uploaded for a while, as we are in the middle of AP testing. :(
If you download the source, you will see that the car is represented by 13 images. Making 39 more images just to have car color isn't going to happen, unless there is some way to alter the color of the car when I am displaying it?
What about the getColorAt / setColorAt methods in GreenfootImage? As long as the car colour is constant and isn't used in any other part of the picture (though you could alter it to a unique colour if that's not the case already) it'd be pretty trivial to loop through, check for a given colour and replace it with whatever colour you want. Unless my head's not working properly and there's some logic I'm missing!
doesn't getColorAt get confused over pixels with transparency? And if there is a large range of colors, it might be quite tedious checking for them all. But i have an idea, let me go expirement
A new version of this scenario was uploaded on Wed May 20 15:20:37 UTC 2009
Your stuff is amazing! do you think you could help me with something for my intro class project? I am creating a game of chance foot race. I have 5 racers numbered 1-5, the player picks the one he wants to win and then the race begins. I do not want to use keyControl (which is how I have it currently working.
Her is what I am using:
public void begin()
{
int randomLuckyNumber = Greenfoot.getRandomNumber(5);
if(Greenfoot.mouseClicked(this)){
Greenfoot.getRandomNumber(5);
if((randomLuckyNumber+1) == luckyNumber){
move();
this being the start button. I want racers 1-5 to move randomly until there is a winner. But this will only give me one random number per click, I just want to click and begin the random numbers 1-5 to continue repeatedly. Any input would be greatly appreciated. Thanks!
I'm glad you are showing such interest in my project :) First make sure you understand which colors in which images do what. For the m# images, this is the texture file. For the R# image files, these are the masks and the colors are as follows:
Black: Solid
Cyan: Solid for enemy (for help driving)
green: start
blue: 1/3 point
yellow: 2/3 point
White: empty
Start positions are set in the racetrack() constructor (by bad code convention :P) and are located in the X/Yar array and the X?Ybr for your opponent. I also believe the rotation always starts looking the same direction as well, so you will need to take that into account, or feel free to change the code to add whatever functionality you want!
If you wanted, you could even email me some of the maps you made and I can put them up in this scenario along with your name and thanks :)
It's really cool that this could be remade in Greenfoot. The one complaint I have is that you didn't really leave any comments in your code, and it's kind of hard to figure out what's going on, at least for me.
I love this engine.
Yeah thats probably one of the largest downsides of the way I code XD I tend to not comment at all or a lot, and my variable names are pretty cryptic. But i'm glad you like it :) Have you checked out some of my other 3D engines such as Castle Storm 2? (I would not recommend Castle Storm 1 at all, since it was written when my coding was even more horrible).
I did check them out. Amazing.
I just started working with java, but it's pretty easy, and I thought I was pretty good. Then there YOU go and make 3-D engines. :P
Keep up the good work so I can plagiarize your code XD
jk jk jk
I noticed a few small things; the dice at the top I assume are based on the arrow keys, not the centripitol, i think, force, so before you start moving, the dice fly to the side pressing the arrow keys, but that can easily be fixed by not doing it as long as your velocity is == 0. Also, The dice fell from the top when I was hit, so I dont know if it was supposed to do that, but if it was, thats pretty awesome. I was also curious if the opponent is more of a AI or just follows a defined path. AI's would probably steer back on the path if you knock them around, or they might try to cut you off, or take corners a bit different.
2009/4/22
2009/5/5
2009/5/5
2009/5/6
2009/5/10
2009/5/10
2009/5/11
2009/5/11
2009/5/11
2009/5/12
2009/5/20
2009/5/20
2009/5/20
2009/6/18
2009/6/18
2009/12/25
2009/12/26
2010/5/1
2010/10/31
2010/12/3
2010/12/12
2011/1/11
2011/1/12
2011/1/12
2011/1/13
2011/1/14
2011/1/14
2011/9/2
2012/7/5
2012/11/17
2013/1/2
2013/1/3
2013/2/24
2013/2/24
2013/3/18
2013/4/21
2013/4/24
2013/6/16
2014/7/2
2014/8/7
2014/10/29
2014/10/29
2015/2/13
2016/10/13
2017/3/1
2017/7/26