Thanks! I made the image work by putting a this in the bat constructor for the PApplet instead of p. However, there’s another problem, somewhat unrelated to the original problem: oddly enough, it won’t let me create object classes in the bat class. I want to create a coin by adding one to an arraylist:
coinlist.add(new coin (xlocation, ylocation, 1, elocation));
but it doesn’t work. There is no error or anything, it’s just that nothing happens- nothing gets added to the arraylist. (just for a little background, a coin object is one that shows a coin on screen that you can pick up). I have tried making a method in the main class that gets called in the bat class, which runs that line of code, but it still doesn’t do anything. Despite this, the coins still seem to work, because if I make a coin somewhere else in the code, it makes a coin. It just doesn’t work when it’s run from the bat class.
What should I do to fix this problem?