public class

PongScreen

extends ShapeScreen
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ sofia.app.Screen
             ↳ sofia.app.ShapeScreen
               ↳ sofia.demos.pong.PongScreen

Class Overview

An implementation of the classic Pong game, using Sofia shapes, animation, and collision detection.

Summary

[Expand]
Inherited Constants
From class android.app.Activity
From class android.content.Context
[Expand]
Inherited Fields
From class android.app.Activity
Public Constructors
PongScreen()
Public Methods
void initialize()
Initializes the shapes for the game.
void onCollisionBetween(Ball ball, ViewEdges edges)
Called when a shape of type Ball collides with one or more of the edges of the view.
void onTouchDown(MotionEvent e)
Moves the paddle when the user touches down on the screen.
void onTouchMove(MotionEvent e)
Moves the paddle when the user moves his or her finger on the screen.
[Expand]
Inherited Methods
From class sofia.app.ShapeScreen
From class sofia.app.Screen
From class android.app.Activity
From class android.view.ContextThemeWrapper
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.KeyEvent.Callback
From interface android.view.LayoutInflater.Factory
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.Window.Callback
From interface sofia.app.ScreenMethods

Public Constructors

public PongScreen ()

Public Methods

public void initialize ()

Initializes the shapes for the game.

public void onCollisionBetween (Ball ball, ViewEdges edges)

Called when a shape of type Ball collides with one or more of the edges of the view.

public void onTouchDown (MotionEvent e)

Moves the paddle when the user touches down on the screen.

Parameters
e the motion event

public void onTouchMove (MotionEvent e)

Moves the paddle when the user moves his or her finger on the screen.

Parameters
e the motion event