📄 friend.java
字号:
/***********************************************************************Copyright Notice: This source code is (C) Copyright 1995-96, EarthWeb LLC.,All Rights Reserved. Distribution of this document or it's resultingcompiled code is granted for non-commercial use, with prior approval ofEarthWeb LLC. Distribution of this document or its resulting compiledcode, for commercial use, is granted only with prior written approval ofEarthWeb, LLC. For information, send email to info@earthweb.com.***********************************************************************/// $Id: Friend.java,v 1.3 1996/04/16 20:55:23 greg Exp $import java.lang.Math;import java.awt.*;/*Strangely enough, a Friend is really one of the enemies that are alwaysshooting at your ship. See comments in 'Figure' for more details.*/public class Friend extends Figure{ static int fs = 8; static int shape[][][] = {{{0,fs},{fs,0}},{{fs,0},{-fs,0}},{{-fs,0},{0,fs}}}; Friend() { super( shape ); } // Create a Friend which is placed sitting on the given line. static Figure onEdge( int sx, int sy, int ex, int ey ) { Friend f = new Friend(); double angle = Math.atan2( sy-ey, sx-ex ); return f.transform( (sx+ex)/2, (sy+ey)/2, angle ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -