2012年2月27日

坦克大战(TankWar)

摘要: 花了一个星期的时间把马士兵老师讲的那个单机版坦克大战编好了,在编写过程中经常出错,由于对debug使用还不是很熟练,每次修复bug都要花很长时间,现在终于编好了个demo,给大家分享下编TankWar,主要功能有 1.能够四处移动、2.-能够打击敌人 3.敌人能够移动 4.能够模拟爆炸 5.能够产生障碍编程过程中的思想:* 1.首先先new出一个frame,并设置大小,位置,* 2.用户不能改变窗口大小,监听窗口关闭* 3.画出一个子弹,设置大小和颜色* 4.让坦克动起来,将a位置改变为变量,b启动线程不断重画 ,c每次重画改变Tank位置* 5. 使用双缓冲消除闪烁现象,将所有东西画在虚拟图 阅读全文

posted @ 2012-02-27 20:30 forrest001 阅读(3632) 评论(10) 推荐(7) 编辑

android menu

摘要: android的菜单有三种:Options Menu 当用户按下menu button按钮时显示的菜单 Context Menu 当用户长久按住屏幕,即被注册显示上下文菜单的视图时显示的菜单 Submenu 当用户按下一个菜单的某个选项时弹出的子菜单By default, every Activity supports an options menu of actions or options. You can add items to this menu and handle clicks on your additions. The easiest way of adding ... 阅读全文

posted @ 2012-02-27 19:46 forrest001 阅读(995) 评论(0) 推荐(1) 编辑

android Tabhost

摘要: 把官网上的tabhost demo 写下来给大家共享下。在两个月前看这个代码还不会的,英语本来就差,现在感觉好接受一点了To create a tabbed UI, you need to use a TabHost and a TabWidget. The TabHost must be the root node for the layout, which contains both the TabWidget for displaying the tabs and a FrameLayout for displaying the tab content大致翻译:创建个tab UI,你需要 阅读全文

posted @ 2012-02-27 18:23 forrest001 阅读(1274) 评论(1) 推荐(3) 编辑

导航