Hi I'm trying to get a game where I have an actor holding a sword, which is another actor. Im making it so I set the sword's location to the character actor's location. When I run my code an error appears saying non-static variable xloc cannot be referenced from a static context.
Character's Actor:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Character1 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Character1 extends Actor
{
public int xloc = getX();
public int yloc = getY();
Sword Actor Code:
public class Sword extends Actor
{
public int xlocation = Character1.xloc;
public int ylocation = Character1.yloc;

