This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Discussions
You need to login to take part
Current Discussions
wrong values
By erdelf, with 5 replies.
Last reply by erdelf, over 12 years ago:
thx danpost. it works without problems now
Drawing text on screen
By -nic-, with 6 replies.
Last reply by -nic-, over 12 years ago:
i will very much so i have just used images in the past but im having troubles with images using greenfoot4android
short question to if()
By Mux, with 3 replies.
Last reply by Mux, over 12 years ago:
thanks got it
getColorAt() doesn't work out
By Mux, with 8 replies.
Last reply by Mux, over 12 years ago:
Thanks for all the help i got the problem fixed now.
Help with a Game counter.
By cpiggott, with 3 replies.
Last reply by -nic-, over 12 years ago:
btw you could use robotsDestroyed += 1; or robotsDestroyed++; instead of robotsDestroyed = robotsDestroyed +1;
snake, want the movement of snake to stop when touching blocks
By kentan, with 2 replies.
Last reply by danpost, over 12 years ago:
You can create a public boolean method in the Snake class to return the state of intersecting a block and call it from the world class. As an alternative, the method can return the state of an object being at an offset from where the snake object is with 'getOneObjectAtOffset(int, int, class)' before actually making the move.
teleport between pipes
By kentan, with 17 replies.
Last reply by kentan, over 12 years ago:
thanks you.
Explain these codes plz!
By hkrhässleholm, with 1 reply.
Replied to by davmac, over 12 years ago:
If the width of the world is 500, say, then the possible x coordinates are 0,1,2...499. Because you start counting at 0, there are 500 different values, but the largest one is 499, which is the width minus one.
Infinite Array
By macforce, with 6 replies.
Last reply by davmac, over 12 years ago:
I think you also need to think about what your variables are for. What is bodypart for and what is newSnake for? Why do you need both? Also, what is the newArray() method supposed to do?
How do you do this?
By Game/maniac, with 4 replies.
Last reply by danpost, over 12 years ago:
Import the ScoreBoard class and look at how it does it.
NumberFormat exception
By erdelf, with 10 replies.
Last reply by erdelf, over 12 years ago:
thank you for your help this works now; I was dumb and wrote <Code Omitted>instead of <Code Omitted>
add random obstacle
By Tezuka, with 10 replies.
Last reply by Tezuka, over 12 years ago:
ok thx now i got it
Screen Wraping
By bbwf, with 3 replies.
Last reply by bbwf, over 12 years ago:
Got it THANKS!
Lost on how to do a lab. Can anyone help?
By Nameisjonny, with no replies.
Goal: This is comprehensive lab that will require you to apply all the skills learned on the course (i) problem solving, (ii) prototype design, (iii) implementation using Greenfoot and Java and (iv) testing it to make sure it works as expected. Objective: To meet the goal stated above you design your own Greenfoot scenario for a given problem. Also make use of (i) method definition and call (ii) repetition control structure in for loop and while loop and selection control structure in if..else, (iii) definition of a user-defined World, (iv) definition of user-defined Actors and “act” method (understand the act method), and (v) adding objects and strings to the scenarios. We will also learn modular development using methods. We will also learn to use the animations methods we studied. The problem: You are required to create a scenario that plays the game Craps. (Don’t worry we will explain what Craps is.) Craps algorithm: Craps is a game played with a pair of six-faced dice. While there are many variations of the game, we will use a simplified version as explained below: 1. Initial round: a. A played rolls a pair of dice. b. Let the sum of the die1 value and die 2 value be called points. c. If the points is 7 or 11, the player wins and the game ends. d. If the points is 2,3 or 12, the player loses and the game ends. e. If the points is anything other than above go to step 2 for continuing to play, 2. Subsequent rounds: a. The player rolls the pair of dice again. b. Let the sum of the dice be called nextPoints. c. If the nextPoints is same as points scored in the initial round, then the player wins and the game ends. d. If the nextPoints is 7, the player loses and the game ends. e. If the nextPoints is anything other than the above two (c., d.) then the player continues to roll and rules of the subsequent rounds apply. What to do and How to do it? We will develop the solution for the problem in incremental steps. 1. Get a pair of dice and play the game as specified above. It helps to have a friend around so that you can discuss the game with him/her. Understand the various outcomes of dice rolls and the rules for each of these, Specifically make sure you understand what are conditions for terminating the game and the conditions for continuing the game, and also the conditions for a win or a loss. 2. In order to understand programming requirements, we will first develop a prototype to implement the algorithm given above. a. Define a CrapsWorld class as a subclass of World b. Define a Craps class as a subclass of Actor. c. Connect the two by instantiating Craps object inside the CrapsWorld. d. Inside Craps class develop the program for the algorithm given above in steps: code only the “Initial round” and test it. Then develop the code for “subsequent round”. Implement the code using meaningful methods. e. Test the complete program and make sure it works for all cases. 3. After you have completely tested the correctness of the logic, then take the components of the scenario and add animations. For example, the die can be animated. The roll can be animated. You can add other actors like people, trees and barrels (!) to the scenario and make them move around etc. The sky is the limit. Show your originality and creativity.
Variable does not update
By Barador, with 10 replies.
Last reply by -nic-, over 12 years ago:
its okay :)
913
914
915
916
917
918
919
X