This site requires JavaScript, please enable it in your browser!
Greenfoot back
coder123
coder123 wrote ...

2019/6/13

I NEED HELP!

1
2
coder123 coder123

2019/6/13

#
still doesn't compile
Super_Hippo Super_Hippo

2019/6/13

#
It would help if you would state the error instead of saying "it doesn't compile" without any explanation. Otherwise, I can only guess. If it is still this weird error, check if this is really related to that piece of code.
coder123 coder123

2019/6/13

#
here's the error: 2019-06-13 14:22:19.779 java unrecognized type is 4294967295 2019-06-13 14:22:19.779 java *** Assertion failure in -, /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.50.111/AppKit.subproj/NSEvent.m:1977
coder123 coder123

2019/6/13

#
here's my most recent code:
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class ball here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class ball extends SmoothMover
{
    /**
     * Act - do whatever the ball wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private double[] direction;
 
    public ball()
    {
        direction = new double[] {1, -1}; //-45°
    }
 
    public void act()
    {
        setLocation(getExactX()+direction[0], getExactY());
        if (isTouching(Paddle.class))
        {
            direction[0] *= -1;
        }
        setLocation(getExactX(), getExactY()+direction[1]);
        if (isTouching(Paddle.class))
        {
            direction[1] *= -1;
        }
    }
}
Super_Hippo Super_Hippo

2019/6/13

#
Remove the ball class entirely. If the error still comes up (which I guess), then it has nothing to do with it. I suggest to restart Greenfoot/your PC and see if something changes. Other than this, did you recently made any changes/updates to your Java version?
coder123 coder123

2019/6/14

#
here's my actor layout:
coder123 coder123

2019/6/14

#
no, i didn't
You need to login to post a reply.
1
2