blue = Color.new(56,172,236)
BG = {}
BG[1] = {x = 0, y = 0, pic = Image.load("Neptarento-1.png")}
BG[2] = {x = 0, y = 270, pic = Image.load("Neptarento-2.png")}
BG[3] = {x = 480, y = 0, pic = Image.load("Neptarento-3.png")}
BG[4] = {x = 480, y = 270, pic = Image.load("neptarento-4.png")}
BG[5] = {x = 0, y = 0, pic = Image.load("starterbottom.png")}
BG[6] = {x = 0, y = 0, pic = Image.load("startershousebedroom.png")}
image = {}
image[1] = Image.load("char1-fstand.png")
image[2] = Image.load("char1-fright.png")
image[3] = Image.load("char1-fleft.png")
image[4] = Image.load("char1-bright.png")
image[5] = Image.load("char1-bstand.png")
image[6] = Image.load("char1-lright.png")
image[7] = Image.load("char1-lstand.png")
image[8] = Image.load("char1-rright.png")
image[9] = Image.load("char1-rstand.png")
place = 1
while place == 1 do
screen:clear()
pad = Controls.read()
screen:blit (BG[6].x, BG[6].y, BG[6].pic)
screen:blit(playerx, playery, image[player_direction])
if pad:left() and playerx>=-1 then
    	if CurrentTime % 2 == 0 then
    	 player_direction = 6
    	    playerx = playerx -1

    	  else
    	  player_direction = 7
    	  playerx = playerx -1

    
	

	end   
	end
	
	if pad:right() and playerx<=263 then
	     if CurrentTime % 2 == 0 then
 	     player_direction = 8
	
 	      playerx = playerx +1
 	
 	    else
 	     player_direction = 9

   	    playerx = playerx +1
       
 	    end 

	end

	if pad:up() and playery>= 0 then

  	if CurrentTime % 2 == 0 then
   	 player_direction = 4

  	  playery = playery -1


 	 else  
   	player_direction = 5

  	 player = playery -1 
	end
	end
 	if pad:down()  and playery<=78 then
 	 if CurrentTime % 2 == 0 then 
	   player_direction = 1
	
	   
 	   playery = playery +1 

 	 else
 	  player_direction = 2
  	  playery = playery +1

 	 end 
	end 
	if pad:up() and playery==22 and playerx>=240 and playerx <=246 then
	place = 1

	end
	screen:print(101,210,playerx, blue)

end
screen:print(101,230, playery, blue)
screen.waitVblankStart()
screen.flip()
oldpad = pad

end