画铅笔画眼睛的画法步骤的地方为什么是除100而不是50呢?

做了个100层楼,虽然是简笔画版的...【java吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:644,062贴子:
做了个100层楼,虽然是简笔画版的...收藏
等级太低没法上传附件,只能发源码了。水平略低!好像没有体现OOP的思想,而且重新开始和UI做得也不好。所以还请大家指点!import java.awt.*;import java.awt.geom.*;import java.awt.event.*;import javax.swing.*;import javax.swing.Timport java.util.Rimport java.util.Spublic class HundredFloors{static MyFstatic final int MOVE_TIME = 100;public static void main(String []args){ActionListener listener = new MyComponent.TimeListener();Timer timer = new Timer(MOVE_TIME,listener);timer.start();EventQueue.invokeLater(new Runnable(){public void run(){frame = new MyFrame();frame.setTitle(&100层楼...v0.0.1&);frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);frame.setVisible(true);}});}static void rePaint(){frame.repaint();}static void end(){System.exit(-1);}}class MyFrame extends JFrame{static final int DEFAULT_WIDTH = 500;static final int DEFAULT_HEIGHT = 600;public MyFrame(){setSize(DEFAULT_WIDTH,DEFAULT_HEIGHT);add(new MyComponent());addKeyListener(new KeyAdapter(){
public void keyPressed(KeyEvent e){
char charA = e.getKeyChar();
switch(charA){case 'a':Man.x -= Man.MOVE_SPEED;if(Man.x &= MyComponent.BOUND_WIDTH)Man.x = MyComponent.BOUND_WIDTH;case 'd':Man.x += Man.MOVE_SPEED;//30是干扰if(Man.x &= DEFAULT_WIDTH-Man.WIDTH-30)Man.x = DEFAULT_WIDTH-Man.WIDTH-30;}
});}}class MyComponent extends JComponent{static final int MAKE_NEWFLOOR_TIME = 5000;//每MAKE_NEWFLOOR_TIME/1000秒生成一个新层static int NOW_TIME = 0;static int TOTAL_TIME = 0;//游戏开始总时间,其实有这个就没必要用NOW_TIME了,懒得改咯static final int BOUND_WIDTH = 100;static final int BARRIER_HEIGHT = 10;static private final int MAX_FLOORS = 100;static private int nowFloor = 0;static int scores = 0;//得分static Floor []floors = new Floor[MAX_FLOORS];static Man man = new Man();static boolean PRINT_START_WORD =//为了使开始文字只打印一次的标志static boolean HAS_ADD_SCORE =static void restart(){floors = new Floor[MAX_FLOORS];nowFloor = 0;Man.fall =//初始化为掉落Man.fail =Man.x = MyComponent.BOUND_WIDTH+WIDTH;Man.y= 9*5-3;Man.blood = 100;scores = 0;}public void printBarrier(Graphics2D g2D,Rectangle2D rect){final int GAP = 10;for(int i=1;i * GAP & rect.getWidth();i++){//-1是因为OUT_X得到的是矩形外的点,而不在矩形上g2D.drawLine(rect.OUT_LEFT-1+i*GAP+BOUND_WIDTH,rect.OUT_TOP-1,rect.OUT_LEFT-1+i*GAP+BOUND_WIDTH,rect.OUT_BOTTOM);}}void printDebugInfor(Graphics g2D){g2D.drawString(&fall==&+Man.fall,3,250);}public void paintComponent(Graphics g){Graphics2D g2D = (Graphics2D)g;Font f = new Font(&叶根友毛笔行书2.0版&,Font.BOLD + Font.ITALIC,20);g.setFont(f);g.drawString(&100&,29,20);g.drawString(&FLOORS&,6,45);f = new Font(&微软雅黑&,Font.BOLD,15);g.setFont(f);g2D.setPaint(Color.BLUE);g2D.drawString(&Scores:&+scores,3,75);g2D.setPaint(Color.RED);g2D.drawString(&Blood:&+Man.blood,2,90);g2D.setPaint(Color.BLACK);printDebugInfor(g2D);//输出调试信息便于找BUGg2D.draw( new Line2D.Double(0.0,55.0,(double)BOUND_WIDTH,55.0));//要减去那2个数是为了排除窗口标题栏等的干扰g2D.draw((Rectangle2D)new Rectangle2D.Double((double)BOUND_WIDTH,0.0,MyFrame.DEFAULT_WIDTH-BOUND_WIDTH-10,MyFrame.DEFAULT_HEIGHT-40));g2D.setPaint(Color.RED);final Rectangle2D rect = new Rectangle2D.Double((double)BOUND_WIDTH,0.0,MyFrame.DEFAULT_WIDTH-BOUND_WIDTH,BARRIER_HEIGHT);//绘制顶端障碍(尖刺)printBarrier(g2D,rect);for(int i=0;i&=nowFi++)if(floors[i] != null)floors[i].drawFloor(g2D);Man.drawMan(g2D);//前两秒打印开始提示if(NOW_TIME &= 2000 && PRINT_START_WORD){f = new Font(&Segoe Marker&,Font.ITALIC,40-NOW_TIME/50);g2D.setFont(f);g2D.setPaint(Color.RED);g2D.drawString(&Start!&,150+BOUND_WIDTH+NOW_TIME/50,100);}if(Man.fail){System.out.println(&Failed&);g2D.setPaint(Color.RED);Man.Failed(g2D);}}//监听器类static class TimeListener implements ActionListener{public void actionPerformed(ActionEvent e){if(NOW_TIME &= 2000)PRINT_START_WORD =if(NOW_TIME == 0 || NOW_TIME &= MAKE_NEWFLOOR_TIME){//1次生成2个for(int i=0;i&2;i++)new Floor().newFloor(floors,++nowFloor);//防止重合(因为是在同一层上,所以比较平台中心点之间的距离即可)while(Math.abs(floors[nowFloor].x + Floor.WIDTH - (floors[nowFloor-1].x + Floor.WIDTH)) &= Floor.WIDTH)new Floor().newFloor(floors,nowFloor);//之所以为1,是为了在标记NOW_TIME==0时是开始,并于此时生成平台NOW_TIME = 1;}if(TOTAL_TIME % 20000 == 0){Floor.FLOOR_SPEED += 1;//每20秒加速}Man.whatState(floors,nowFloor);//更新人物状态:是否掉落/*--------相关数据更新--------*/NOW_TIME += HundredFloors.MOVE_TIME;TOTAL_TIME += HundredFloors.MOVE_TIME;//这个MOVE_TIME其实相当于每次刷新间隔时间了if(man.fall)man.y += Man.FALLING_SPEED;elseman.y -= Floor.FLOOR_SPEED;/*----------------------------*/for(int i=0;i&=nowFi++)if(floors[i] != null)floors[i].y -= Floor.FLOOR_SPEED;//向上移动if(floors[0] != null && floors[0].y &= BARRIER_HEIGHT){//将floors数组有数据的部分整体前移,以覆盖超出范围的平台for(int j=nowFj&=0;j--)floors[j-1] = floors[j];--nowF}HundredFloors.rePaint();}}}class Floor{static final int NORMAL = 0;static final int HARMFUL = 1;static final int VERYGOOD = 2;static int FLOOR_SPEED = 5;static final int WIDTH = 100;static final int HEIGHT = 15;int floorType = NORMAL;//不定义为final,是另有企图(可以突然改变平台类型坑人)Floor(){x = MyComponent.BOUND_WIDTH;y = MyFrame.DEFAULT_HEIGHT - HEIGHT - 40;//40是干扰}Floor(int aX,int aY){x = aX;y = aY;}void drawFloor(Graphics2D g2D){switch(floorType){case NORMAL:g2D.setPaint(Color.BLACK);case HARMFUL:g2D.setPaint(Color.RED);case VERYGOOD:g2D.setPaint(Color.BLUE);}g2D.fill(new Rectangle2D.Double(x,y,WIDTH,HEIGHT));}void newFloor(Floor floors[],int floor){/*----------------随机生成新的一层-----------------*/Random rand = new Random();int randX;do{randX = rand.nextInt(MyFrame.DEFAULT_WIDTH)+ MyComponent.BOUND_WIDTH-Floor.WIDTH;//画面内平台坐标随机}while(randX &= MyComponent.BOUND_WIDTH || randX &= MyFrame.DEFAULT_WIDTH-Floor.WIDTH);floors[floor] = new Floor(randX,MyFrame.DEFAULT_HEIGHT - HEIGHT - 40);int randType = rand.nextInt(100);if(randType & 5)randType = VERYGOOD;else if(randType &= 65)randType = NORMAL;else randType = HARMFUL;floors[floor].floorType = randT}}class Man{static final int WIDTH = 16;//尽管,用width形容一个人是不是有点...static final int HEIGHT = 30;static final int HEAD_LONG = 8;//头部直径static final int LEGS_HEIGHT = 8;//腿最高处距脚的距离(腿的海拔...)static final int FALLING_SPEED = 6;//下落速度static final int MOVE_SPEED = 4;static boolean fall =//初始化为掉落static boolean fail =static int x = MyComponent.BOUND_WIDTH+WIDTH;static int y = 9*5-3;static int blood = 100;static void drawMan(Graphics2D g2D){g2D.setPaint(Color.BLACK);/*------画这个人花了30分钟...美术不好,哈哈------*/g2D.draw(new Ellipse2D.Double(x+WIDTH/2-HEAD_LONG/2,y,HEAD_LONG,HEAD_LONG));//画头部//画身子g2D.draw(new Rectangle2D.Double(x,y+HEAD_LONG,WIDTH,HEIGHT-HEAD_LONG-LEGS_HEIGHT));//画腿g2D.draw(new Line2D.Double(x+WIDTH/2,y+HEIGHT-LEGS_HEIGHT,x,y+HEIGHT));g2D.draw(new Line2D.Double(x+WIDTH/2,y+HEIGHT-LEGS_HEIGHT,x+WIDTH,y+HEIGHT));}static void whatState(Floor []floors,int nowFloor){for(int i=0;i&=nowFi++)if(floors[i] != null){//判断掉落状态if(floors[i].x & Man.x+WIDTH && floors[i].x+Floor.WIDTH & Man.x&&floors[i].y &= Man.y + HEIGHT && floors[i].y+Floor.HEIGHT &= Man.y + HEIGHT-4)//允许误差{fall =if(floors[i].floorType == Floor.VERYGOOD){MyComponent.scores += 2;}else if(floors[i].floorType == Floor.HARMFUL)Man.blood -= 1;elseMyComponent.scores += 1;}else{fall =}if(Man.y &= 0)fail =else if(Man.y &= MyFrame.DEFAULT_HEIGHT)fail =else if(Man.blood &= 0)fail =elsefail =}}static void Failed(Graphics g2D){System.out.println(&Failed&);System.out.println(&Enter 0 to restart ,1 to exit&);Font f = new Font(&叶根友毛笔行书2.0版&,Font.BOLD + Font.ITALIC,40);g2D.setFont(f);Scanner sc = new Scanner(System.in);boolean loop =while(loop){g2D.drawString(&FAILED!&,100,200);if(sc.nextInt() == 0){loop =MyComponent.restart();}else if(sc.nextInt() == 1){loop =HundredFloors.end();}}}}
2017java学习来上市公司博为峰学java,入学即签就业协议,不就业不收费,查看java课程!java好学吗?java课程来博为峰学,java工程师就业年薪十几万!
楼主在吗?
我想问一下你几个问题,行不行呢?大神
登录百度帐号推荐应用你的位置: >
> 100张漂亮的铅笔画作品欣赏
Brian Scott 是一位来自英国爱丁堡自学成才的插画家,他的大部分工作时间就是用彩色铅笔画出一些逼真的人物肖像画,今天收集分享:100张漂亮的铅笔画作品欣赏,说不定里面还有你现在用的头像的铅笔画版本,希望其中有你喜欢和需要的,或者可以给你带来灵感的。
转载请注明: &
与本文相关的文章查看: 4685|回复: 17
细的英雄100用什么蓝黑墨水不堵笔?颜色好?
细的英雄100用什么蓝黑墨水不堵笔?颜色好?求指点。
黑色的选什么,不要太贵啊。
细的英雄100用什么蓝黑墨水不堵笔?颜色好?求指点。
yumyum 发表于
我手头的这支英雄 100 一直在用 LAMY 的蓝黑墨水,供参考。
阅读权限100
国产随便上,我都觉得下水大。不过英雄100特细没用过
谢楼上各位已经买了派克的,看其他帖子说他的黑也算蓝黑。
派克的不容易干啊。话说最近对龙水的午夜藍 很满意。
阅读权限100
100是很容易干的,建议最好不要用黑水啊
100配派克水在有些纸上写不容易干,而且经常写完一面在翻页时,容易把两页纸粘在一起
阅读权限100
青墨、百乐蓝黑
阅读权限255
国产蓝黑墨水都可以啊!喜欢偏蓝色调就用达克斯,鸵鸟923。喜欢偏灰色调就用鸵鸟913,珠江和奥林丹。
阅读权限255
从小学开始基本都是鸵鸟313
派克的墨水?手不小心碰中,难洗啊
派克的确不容易干,手经常弄黑
嗯,用了一段时间发现确实不易干,经常蹭一手。有什么好看的墨水推荐吗?表要上百的,太贵啦....
呃,最好别带香味,闻着嗓子里发甜,好像有血一样.........武侠片看多了.....
阅读权限100
& & 请问,为什么不要用黑的呢?我也在纠结要用什么墨水。本来打算用4001的。可是看到你这么说我就不敢用了
& & 我用的派克黑色,半个月一笔下水。仅供参考昂。
阅读权限100
回复&&ka958
& & 请问,为什么不要用黑的呢?我也在纠结要用什么墨水。本来打算用4001的。可是看到你 ...
影无影 发表于
& &这个还不是黑水呢,就成这样,然后我换了另外一种钢笔水就行了。
如果用黑的就尽量选择颜料墨水,比如咱们国产的英雄440,物美价廉就不错啊。
Powered by

我要回帖

更多关于 简单的铅笔画 的文章

 

随机推荐