<?xml version="1.0" encoding="UTF-8"?>
<class name="Gruenfisch" extends="Actor" extends-java="Actor" enable="true" strideversion="1">
    <javadoc xml:space="preserve"/>
    <imports>
        <import target="java.util.*" enable="true"/>
        <import target="greenfoot.*" enable="true"/>
    </imports>
    <implements/>
    <fields>
        <variable access="private" type="int" type-java="int" name="booster" value="300" value-java="300" enable="true"/>
        <variable access="private" type="boolean" type-java="boolean" name="spaceIstGedrueckt" value="false" value-java="false" enable="true"/>
    </fields>
    <constructors/>
    <methods>
        <method access="public" type="void" type-java="void" name="act" enable="true">
            <javadoc xml:space="preserve">Act - do whatever the Gruenfisch wants to do. This method is called whenever the 'Act' or 'Run' button gets pressed in the environment.</javadoc>
            <params/>
            <throws/>
            <body>
                <call expression="this.mouseChecken()" expression-java="this.mouseChecken()" enable="true"/>
                <call expression="this.tastaturChecken()" expression-java="this.tastaturChecken()" enable="true"/>
                <call expression="this.getWorld().showText(&quot;Booster: &quot;+this.boosterCheck(Greenfoot.getRandomNumber(100)),250,80)" expression-java="this.getWorld().showText(&quot;Booster: &quot; + this.boosterCheck(Greenfoot.getRandomNumber(100)), 250, 80)" enable="true"/>
                <call expression="this.move(2)" expression-java="this.move(2)" enable="true"/>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="mouseChecken" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <variable type="MouseInfo" type-java="MouseInfo" name="m" value="Greenfoot.getMouseInfo()" value-java="Greenfoot.getMouseInfo()" enable="true"/>
                <if condition="m!=null" condition-java="m != null" enable="true">
                    <ifStatements>
                        <call expression="this.turnTowards(m.getX(),m.getY())" expression-java="this.turnTowards(m.getX(), m.getY())" enable="true"/>
                    </ifStatements>
                </if>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="tastaturChecken" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <if condition="Greenfoot.isKeyDown(&quot;space&quot;)" condition-java="Greenfoot.isKeyDown(&quot;space&quot;)" enable="true">
                    <ifStatements>
                        <assign dest="this.spaceIstGedrueckt" dest-java="this.spaceIstGedrueckt" src="true" src-java="true" enable="true"/>
                        <if condition="this.booster&gt;0" condition-java="this.booster &gt; 0" enable="true">
                            <ifStatements>
                                <call expression="this.move(4)" expression-java="this.move(4)" enable="true"/>
                                <call expression="this.getWorld().showText(&quot;&quot;,this.getWorld().getWidth()/2,this.getWorld().getHeight()/2)" expression-java="this.getWorld().showText(&quot;&quot;, this.getWorld().getWidth() / 2, this.getWorld().getHeight() / 2)" enable="true"/>
                            </ifStatements>
                            <else>
                                <call expression="this.getWorld().showText(&quot;*** BOOSTER VERBRAUCHT ***&quot;,this.getWorld().getWidth()/2,this.getWorld().getHeight()/2)" expression-java="this.getWorld().showText(&quot;*** BOOSTER VERBRAUCHT ***&quot;, this.getWorld().getWidth() / 2, this.getWorld().getHeight() / 2)" enable="true"/>
                            </else>
                        </if>
                    </ifStatements>
                    <else>
                        <assign dest="this.spaceIstGedrueckt" dest-java="this.spaceIstGedrueckt" src="false" src-java="false" enable="true"/>
                    </else>
                </if>
            </body>
        </method>
        <method access="public" type="void" type-java="void" name="setBooster" enable="true">
            <javadoc xml:space="preserve"/>
            <params>
                <param type="int" type-java="int" name="booster"/>
            </params>
            <throws/>
            <body>
                <assign dest="this.booster" dest-java="this.booster" src="booster" src-java="booster" enable="true"/>
            </body>
        </method>
        <method access="public" type="int" type-java="int" name="getBooster" enable="true">
            <javadoc xml:space="preserve"/>
            <params/>
            <throws/>
            <body>
                <return value="this.booster" value-java="this.booster" enable="true"/>
            </body>
        </method>
    </methods>
</class>
