

class)) //returns a list of all the objects with name Sound.class, should only be one isKeyDown( "A") ) //If the A key is downįor ( Object o : getWorld(). Private void checkForKeys() //Check if certain keys are down SetLocation( getX() + 10, getY()) //Move the document closer to the final location SetLocation( getX() - 10, getY()) //Move the document closer to the final locationĮlse if(! movingLeft & getX() < 804) //If the document is moving right and is not at the final location If( movingLeft & getX() > 566) //If the document is moving left and is not at the final location Private void checkForMovement() //Checking if the document should be moving WriteText() //Write the text onto the screen through the use of creating a GreenfootImage If( noText) //If there is no text currently on the screen for the passport isKeyDown( "D"))ĬheckForMovement() //Check if the passport should be moving SetImage( path + country + ".png") //Sets the image to the countries' passport Lx = 150 //Where the last name should be in relation to the text GreenfootImage PassportFaceX = 740 //Where the face graphic should beįx = 90 //Where the first name should be in relation to the text GreenfootImage TextGraphicY = 344 //Where the passport text should be TextGraphicX = 608 //Where the passport text should be Ly = 29 //Where the last name should be in relation to the text GreenfootImage Lx = 95 //Where the last name should be in relation to the text GreenfootImage PassportFaceY = 365 //Where the face graphic should be TextGraphicY = 357 //Where the passport text should be TextGraphicX = 671 //Where the passport text should be If( country= 1 || country= 6 || country= 7 || country= 13) PassportFaceY = 357 //Where the face graphic should be PassportFaceX = 630 //Where the face graphic should be TextGraphicY = 343 //Where the passport text should beįx = 33 //Where the first name should be in relation to the text GreenfootImageįy = 29 //Where the first name should be in relation to the text GreenfootImage TextGraphicX = 667 //Where the passport text should be If( country= 0 || country= 2 || country= 4 || country= 8 || country= 9 || country= 5 || country= 3 || country= 11)

issueDate = issueDate //Sets parameter to internal variable image = image //Sets parameter to internal variable gender = gender //Sets parameter to internal variable country = country //Sets parameter to internal variable birthDate = birthDate //Sets parameter to internal variable expirationDate = expirationDate //Sets parameter to internal variable lastName = lastName //Sets parameter to internal variable firstName = firstName //Sets parameter to internal variable valid = valid //Sets parameter to internal variable Public Passport( Boolean valid, String firstName, String lastName, String expirationDate, String birthDate, int country, String gender, String issueDate, int image) //Requires document information from the PaperWorld class Private int passportFaceY //Where the passport face should be upon instantiation Private int passportFaceX //Where the passport face should be upon instantiation Private boolean movingLeft = true //If the document is moving left Private int ly //Where the last name should be in relation to the text GreenfootImage Private int lx //Where the last name should be in relation to the text GreenfootImage Private int fy //Where the first name should be in relation to the text GreenfootImage Private int fx //Where the first name should be in relation to the text GreenfootImage Private int textGraphicY //Where the text should be instantiated at Private int textGraphicX //Where the text should be instantiated at Private String path = "passports/Passport" //Where the passport images are held Private Boolean userChoice //If the user has made a choice or not Private boolean noText = true //Boolean used to instantiate the text and image Private int image //Image on the document, generated Private String issueDate //Issue date on the document, generated Private String gender //Gender on the document, generated Private int country //Country on the document, generated Private String birthDate //Birth date on the document, generated Private String expirationDate //Expiration date on the document, generated Private String lastName //Last name on the document, generated Private String firstName //First name on the document, generated Private Boolean valid //If the passport documents are valid Color //Allows for GreenfootImage to work properly with java colours, TextDisplayer class too Import greenfoot.* // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
