Hello everyone,
First off, im really new here so i might need some not too technical answers :),
I'm trying to create an RPG game where a character can throw stars at enemies, ( along the line i would love to have different stars for different character levels or via drop )
Now i have an integer direction ( 1 or 2 ) in my Character class,
and i have a throw left and throw right method :
Now on to my ThrowingStar class,
I Can't seem to get the direction from my char class to my ThrowingStar class..
I Also have multiple subclasses of the class Throwingstars, how can i activate these ?
So far my Throwingstar class contains the following :
However, this will throw the stars to the right wether i'm facing left or right.. :(
Hope you can help me out !
public void luckySeven(int richting)
{
if(richting == 1)
{
throwRight();
}
if(richting == 2)
{
throwLeft();
}
}
public void throwRight()
{
ThrowingStar throwingstar = new ThrowingStar();
getWorld().addObject(throwingstar, getX(), getY());
throwingstar.move(40.0);
throwingDirection = 10.0;
}
public void throwLeft()
{
ThrowingStar throwingstar = new ThrowingStar();
getWorld().addObject(throwingstar, getX(), getY());
throwingstar.move(-40.0);
throwingDirection = -10.0;
}public class ThrowingStar extends Mover
{
public double direction;
/**
* Act - do whatever the ThrowingStar wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(10.0);
}

