If you think the Android project rpg listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package org.aschyiel.rpg;
//www.java2s.comimport org.andengine.entity.sprite.TiledSprite;
import org.aschyiel.rpg.level.Player;
/**
* The "focus" represents the current selection within the game.
* It's context sensitive to the target ( ie. friendly vs. neutral vs.
* enemy targets are to be represented differently ).
*/publicclass Focus extends TiledSprite
{
/**
* Who we're focusing on behalf of.
*/privatefinal Player perspective;
public Focus( Resorcerer rez, Player perspective, int w, int h )
{
super( 0, 0, rez.getTexture( "focus" ), rez.getVertexBufferObjectManager() );
setTarget( null );
this.perspective = perspective;
setSize( (float) w, (float) h );
}
publicvoid setTarget( GameObject unit )
{
// Massive todo.
// if same player or same team, friendly.
// if neautral, say neutral.
// else enemy.
setAlpha( ( null == unit )? 0 : 1 );
}
}