package com.example.lessonTwo;

import android.content.*;
import android.view.*;
import android.graphics.*;
import android.graphics.drawable.*;
import android.graphics.drawable.shapes.*;

public class SpaceCreature extends View 
{	
    public SpaceCreature(Context context) 
    {    	
        super(context);        
    }

    protected void onDraw(Canvas canvas) 
    {
        // MIX MY PAINT
    	Paint greenPaint = new Paint();
        greenPaint.setStrokeWidth(5);
        greenPaint.setColor(Color.rgb(124, 216, 96));
    	
       	// DRAW THE alienBody
        ShapeDrawable alienBody = new ShapeDrawable(new OvalShape());
        alienBody.getPaint().setColor(greenPaint.getColor());	
        // 1st Number = left side of the oval, x coordinate
        // 2nd Number = top side of the oval, y coordinate
        // 3rd Number = right side of the oval, x coordinate
        // 4th Number = bottom side of the oval, y coordinate
        alienBody.setBounds(50, 50, 100, 100);        
        alienBody.draw(canvas); 
                       
       	// DRAW THE LEFT AND RIGHT ARMS
        // 1st and 2nd Numbers - (x, y) of first point on the line
	// 3rd and 4th Numbers - (x, y) of the last point on the line
        canvas.drawLine(52, 65, 52, 120, greenPaint);
        canvas.drawLine(98, 65, 98, 120, greenPaint);

        // DRAW THE LEGS
        canvas.drawLine(65, 65, 65, 130, greenPaint);
        canvas.drawLine(85, 65, 85, 130, greenPaint);
                
        // DRAW THE FEET
        canvas.drawLine(60, 130, 70, 130, greenPaint);
        canvas.drawLine(83, 130, 92, 130, greenPaint);
        
        // DRAW THE EYE
        ShapeDrawable leftEye = new ShapeDrawable(new OvalShape());
        leftEye.getPaint().setColor(Color.WHITE);	
        leftEye.setBounds(60, 60, 80, 80);        
        leftEye.draw(canvas);
        
        // DRAW THE PUPIL
        ShapeDrawable pupil = new ShapeDrawable(new OvalShape());
        pupil.getPaint().setColor(Color.BLACK);	
        pupil.setBounds(68, 70, 73, 75);        
        pupil.draw(canvas);             
    }
}