Back to gusbus123's profile

please tell me if there are still any bugs or problems. :) Only first version, so there isn't that many functions to it, but will be adding extra stuff to it as i go on.
gusbus123

2012/10/29

Oh and i will either make PAXON in a new scenario or make it as a game mode in this scenario. But that will be in a long time... Im too lazy these days, need to get back to coding and away from videos and school :)
By the way i do not understand what your code is saying that is why i am not giving you a fully formated piece of code to you, what i have given you is based on the information i can see from watching what the scenario is doing.
Or another way of doing it which will make the gravity change as it moves up and down would go something like this. initiate a variable called gravity that = 0. have a check in the act that will make the gravity be equal to : (length of wire - distance between y coordinates of center point and the ball) / 10. Then make a check in the area of code where it applies the force which will do : If the ball is going downwards (Dipping down in the U shape) the force applied will + the amount of gravity there is. Otherwise if the ball is going upwards the force applied will - the amount of gravity.
Simple way is to add a variable called gravity that = 1. Then every time it reaches the highest point of which it can go the amount of force applied for it to go back around the other way is reduced by the amount of gravity there is.
heres one way of doing it. All i did was add a check for when one of those 4 keys are down that goes around their seperate checks, so the first line of this code. [code]if(Greenfoot.isKeyDown("up") || Greenfoot.isKeyDown("down") || Greenfoot.isKeyDown("left") || Greenfoot.isKeyDown("right")) { if (Greenfoot.isKeyDown("up")) { setLocation(getX(), getY() - 5); } if (Greenfoot.isKeyDown("down")) { setLocation(getX(), getY() + 5); } if (Greenfoot.isKeyDown("left")) { move(-5); runLeft(); facing = "left"; } if (Greenfoot.isKeyDown("right")) { move(5); runRight(); facing = "right"; } } else { updateImage(); }[/code]
in your void control every time u use the keys: up,down and left you will still run through the check right key button. And when you dont have your right key down it will update the image. thats y every time you have u go left it will change the image to the left image then imediately change to the look right image.
i might do somthing like this with different atributes, if i do then just saying i havnt looked at your code.
you should make it so the bug can get to the edge of the world, not stop in the middle of it. Makes a bit more sense. other than that its great :)