I want to make a little RPG game, kinda old style zelda kinda thing. I have gotten the actor to move on the x axis, but how do i get it to move up and down via pressing the up and down arrow keys?
This is the code i have so far:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Charforward here.
*
* @author (oaks)
* @version (0.1)
*/
public class Charforward extends Actor
{
/**
* Act - do whatever the Charforward wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (Greenfoot.isKeyDown ("left"))
{move(-4); }
if (Greenfoot.isKeyDown ("right"))
{move(4); }
if (Greenfoot.isKeyDown ("up"))
{ move ();}}}
I've only started using Greenfoot about 2 days ago, so i'm probably missing something really obvious.
Thanks,

