nvm fixed it

import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class player here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class player extends Actor
{
final int jSpeed = 20; //jump speed
int ySpeed = 0, xSpeed = 0;
boolean aboutFace;
boolean onGround;
/**
* Act - do whatever the player wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move();
}
private void move()
{
int dx = 0;
if (Greenfoot.isKeyDown("a")) dx--;
if (Greenfoot.isKeyDown("d")) dx++;
for (int i=0; i<speed; i++)
{
setLocation(getX() + dx, getY());
if (getOneIntersectingObject(blocks.class) == null) continue;
setLocation(getX(), getY() + 1);
if (getOneIntersectingObject(blocks.class) == null) continue;
setLocation(getX(), getY() - 2);
if (getOneIntersectingObject(blocks.class) == null) continue;
setLocation(getX() - dx, getY() + 1);
return;
setLocation(getX() + dx, getY());
if (getOneIntersectingObject(hostiles.class) == null) continue;
getWorld.removeObject(this);
return;
}
}
/**
* Determines any changes in horizontal and vertical speeds for the actor.
*/
private void getDirection()
{
//if (!onGround) return; // if not mid-air changes allowed
// sets requested direction of move, or continues in current direction
if (Greenfoot.isKeyDown("up") && onGround) // check jump
{
ySpeed -= jSpeed;
}
}
}