Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Steelwall.java
Package: BattleTank1.0.rar [view]
Upload User: jhzhutan
Upload Date: 2021-03-28
Package Size: 374k
Code Size: 1k
Category:
Shot Game
Development Platform:
Java
- import java.awt.*;
- public class Steelwall implements Actor{
- public final String Type = "Steelwall";
- public Image Steelwall;
- public int xPos;
- public int yPos;
- public boolean[] shape;
- public ClientModel gameModel;
- public Steelwall(int xPos, int yPos, int orientation, ClientModel gameModel){
- this.xPos = xPos;
- this.yPos = yPos;
- this.gameModel = gameModel;
- shape = new boolean[4];
- Steelwall = gameModel.textures[53];
- if(orientation == 0){
- shape[2] = true;
- shape[3] = true;
- }
- if(orientation == 1){
- shape[0] = true;
- shape[1] = true;
- }
- if(orientation == 2){
- shape[1] = true;
- shape[3] = true;
- }
- if(orientation == 3){
- shape[0] = true;
- shape[2] = true;
- }
- }
- public void draw(Graphics g){
- boolean walldestoried = true;
- for(int i = 0; i < shape.length; i++)
- if(!shape[i]){
- walldestoried = false;
- break;
- }
- if(walldestoried)
- return;
- g.drawImage(Steelwall, xPos - 12, yPos - 12, null);
- g.setColor(new Color(128, 64, 0));
- if(shape[0])
- g.fillRect(xPos - 12, yPos - 12, 13, 13);
- if(shape[1])
- g.fillRect(xPos, yPos - 12, 13, 13);
- if(shape[2])
- g.fillRect(xPos - 12, yPos, 13, 13);
- if(shape[3])
- g.fillRect(xPos, yPos, 13, 13);
- }
- public int getxPos(){
- return xPos;
- }
- public int getyPos(){
- return yPos;
- }
- public String getType(){
- return Type;
- }
- }