This site requires JavaScript, please enable it in your browser!

What is happening right now?


reply to Need help with small bit of code

By danpost - 14 minutes ago
There are two Actor methods that can change the location of an actor in the world -- 'move(int)' and 'setLocation(int, int)'. With 'move(int)', you can use negative values for the 'int' to make the actor move backwards. As a possible alternative, you can use 'turn(180)'; but, note that the image of the actor will be upside down. With 'setLocation(int, int), you can "move" by 'dx' horizontally and by 'dy' vertically by using 'setLocation(getX()+dx, getY()+dy)'. Negative values will reposition left or up and positive values will reposition right or down.

reply to Maths Game

By Super_Hippo - 19 minutes ago
If the answer to your question (in the game) is actually the color itself, then it isn't an integer. Then you couldn't use an array for your answers, but a list (because arrays can only handle one data type, not integer and strings for example). In this list, you place >"Red"< instead of >Red< then. (You should compare the strings cap-neutral then.) If your color names are meant to represent a number like you coded it (so you set Red, Blue and so on to a number somewhere), then ignore this post.

reply to How would I make buttons spawn in the world and play sounds when clicked?

By davmac - about 3 hours ago
mobileash66, please use 'code' tags when posting code. (Click the link that says "Posting code? read this!" under the text entry area). Your code above looks wrong because it contains: <Code Omitted> ... which creates italic text.


By danpost - about 8 hours ago
You should have the 'counters' field declared in the world class; plus, you should have the Counters object being created and added into the world somewhere in the world class. Again, maybe you should post your world class code. Oh, and please use the 'code' link below the 'Post a reply' content box to insert your code into your post.