哪里有愤怒的小鸟java源代码的java版的游戏下载?

所属类别:iPhone_iPad游戏 &更新时间: & 点击数:
愤怒的小鸟J***A完美版 测试完美支持C6
iPhone_iPad游戏相关
上一篇文章:
下一篇文章:
本类游戏下载
&&&&&&&&&&&
热门模拟游戏
&&&&&&&&&&&
手机应用下载
&&&&&&&&&&&
电脑街机游戏
&&&&&&&&&&&Java游戏开发愤怒的小鸟AngryBirds游戏源码
Java游戏开发愤怒的小鸟AngryBirds游戏源码
142735hef7iejzo6pfe7ij.jpg (198.89 KB, 下载次数: 12)
09:51 上传
nlxffqux1fxlg.jpg (113.32 KB, 下载次数: 2)
09:51 上传
网上看到的例子和源码,希望给喜欢的童鞋一点参考价值哈。(不是android代码,是J***A的。)
推荐学习视频
下载地址:
游客,如果您要查看本帖隐藏内容请
谢谢谢谢谢谢谢谢谢谢
谢谢楼主分享& &谢谢楼主分享& &谢谢楼主分享& &谢谢楼主分享
轻松打造安卓高级工程师打造会代码的全能UI设计师做被争抢的ios开发者
? ? ? ? ? ? ? ? ? ?
Powered by下载了当前应用的网友还下载了下列应用
抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活
(C)巴士创想 广东梅州卓众网络科技股份有限公司
粤ICP备号-1技术浅谈(40)
今天给大家介绍一下Java swing实现游戏愤怒的小鸟的过程,完整源码下载地址在最下方,老规矩,先看运行结果:
下面我们来看看代码:
* To change this template, choose Tools | Templates
* and open the template in the editor.
package AngryBirdsA
import java.awt.event.KeyE
import java.awt.event.MouseA
import java.awt.event.MouseE
import java.awt.event.MouseMotionL
import java.io.IOE
import java.util.logging.L
import java.util.logging.L
import org.jbox2d.callbacks.ContactI
import org.jbox2d.callbacks.ContactL
import org.jbox2d.collision.M
import mon.Vec2;
import org.jbox2d.dynamics.F
import org.jbox2d.dynamics.contacts.C
* @author Sumomoxiao
public class AngryBirdsController extends MouseAdapter implements Runnable, MouseMotionListener, ContactListener {
private AngryBirdsArea m_
public AngryBirdsPanel m_
private final AngryBirdsD
// private final MusicC
boolean stop =
AngryBirdsController(AngryBirdsArea m, AngryBirdsPanel v){//, MusicController mc) {
this.m_stage =
drawer = v.getSDDraw();
v.setStageController(this);
m.initStage();
drawer.setStage(m);
this.addListener();
public void run() {
while (true) {
while (!stop) {
m_stage.update();
drawer.drawStage();
Thread.sleep(5);
} catch (InterruptedException ex) {
drawer.drawStage();
Thread.sleep(12);
} catch (InterruptedException ex) {
Logger.getLogger(AngryBirdsController.class.getName()).log(Level.SEVERE, null, ex);
public void start() {
if (gamethread == null) {
gamethread = new Thread(this);
gamethread.start();
public void pause() {
if (isPainting()) {
public void resume() {
if (!isPainting()) {
public boolean isPainting() {
return m_view.isPainting();
* synchronized public void setRunthread(boolean runthread) {
* if(this.stop!=runthread){ this.stop = }
public void addListener() {
m_view.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (m_stage != null) {
Vec2 pos = new Vec2(e.getX(), e.getY());
if (e.getButton() == MouseEvent.BUTTON1) {
drawer.getScreenToWorldToOut(pos, pos);
m_stage.queueMouseDown(pos);
public void mouseReleased(MouseEvent e) {
if (m_stage != null) {
Vec2 pos = new Vec2(e.getX(), e.getY());
drawer.getScreenToWorldToOut(pos, pos);
m_stage.queueMouseUp(pos);
m_view.addMouseMotionListener(new MouseMotionListener() {
final Vec2 posDif = new Vec2();
final Vec2 pos = new Vec2();
final Vec2 pos2 = new Vec2();
public void mouseDragged(MouseEvent e) {
pos.set(e.getX(), e.getY());
if (m_stage != null) {
drawer.getScreenToWorldToOut(pos, pos);
m_stage.queueMouseMove(pos);
public void mouseMoved(MouseEvent e) {
pos2.set(e.getX(), e.getY());
if (m_stage != null) {
drawer.getScreenToWorldToOut(pos2, pos2);
m_stage.queueMouseMove(pos2);
public synchronized void beginContact(Contact contact) {
drawer.drawContact();
System.out.print(&listener thread !!!\n&);
public void endContact(Contact contact) {
public void preSolve(Contact contact, Manifold oldManifold) {
// throw new UnsupportedOperationException(&Not supported yet.&);
public void postSolve(Contact contact, ContactImpulse impulse) {
if (contact.m_fixtureA.m_filter.groupIndex == -1 || contact.m_fixtureB.m_filter.groupIndex == -1) {
fix = contact.m_fixtureA.m_filter.groupIndex == -1?contact.m_fixtureA:contact.m_fixtureB;
for (int i = 0; i & contact.getManifold().pointC i++) {
if (impulse.normalImpulses[i] & 0.8) {
System.out.print(&pushing point \n&);
drawer.pushContactPoint(fix.m_body.getPosition());
//music.birdScream();
} catch (IOException ex) {
if (contact.m_fixtureA.m_filter.groupIndex == 1 || contact.m_fixtureB.m_filter.groupIndex == 1) {
// System.out.print(& impulse point count
: &+impulse.normalImpulses.length+&\n&);
for (int i = 0; i & contact.getManifold().pointC i++) {
//System.out.print(&wood impulse : &+impulse.normalImpulses[i]+&\n&);
if (impulse.normalImpulses[i] & 3.1f) {
//System.out.print(&wood impulse : &+impulse.normalImpulses[i]+&\n&);
//music.woodCollision();
} catch (IOException ex) {
* To change this template, choose Tools | Templates
* and open the template in the editor.
package AngryBirdsC
import javax.swing.ImageI
import org.jbox2d.collision.shapes.CircleS
import org.jbox2d.collision.shapes.S
import mon.Vec2;
import org.jbox2d.dynamics.B
import org.jbox2d.dynamics.BodyD
import org.jbox2d.dynamics.FixtureD
import org.jbox2d.dynamics.W
* @author SONY
public class AngryBirdsModel extends AngryBirdsCharacter{
public ImageIcon birds1=new ImageIcon(&src/AngryBirdsImagePack/birds.png&);
public ImageIcon birds2=new ImageIcon();
public ImageIcon birds3=new ImageIcon();
AngryBirdsModel() {
public Body createBirds(World mom,int birdtype,Vec2 pos) {
this.getCharacterdef().position.set(pos);
this.getCharacterdef().linearDamping=0.01f;
this.getCharacterfixdef().filter.groupIndex=-1;
this.charactershape=new CircleShape();
Body bird=mom.createBody(characterdef);
switch(birdtype) {
this.charactershape.m_radius=0.5f;
this.getCharacterfixdef().shape= this.
this.getCharacterinfo().setName(&Lil Bird&);
this.getCharacterinfo().setHafheight(0.5f);
this.getCharacterinfo().setHafwidth(0.5f);
this.getCharacterinfo().setAppearance(birds1.getImage());
bird.m_userData=this.getCharacterinfo();
bird.createFixture(characterfixdef);
this.charactershape.m_radius=0.7f;
this.getCharacterfixdef().shape= this.
this.getCharacterinfo().setName(&Strong Bird&);
this.getCharacterinfo().setHafheight(0.7f);
this.getCharacterinfo().setHafwidth(0.7f);
this.getCharacterinfo().setAppearance(birds2.getImage());
bird.m_userData=this.getCharacterinfo();
bird.createFixture(characterfixdef);
this.charactershape.m_radius=1f;
this.getCharacterfixdef().shape= this.
this.getCharacterinfo().setName(&Angry Bird&);
this.getCharacterinfo().setHafheight(1f);
this.getCharacterinfo().setHafwidth(1f);
this.getCharacterinfo().setAppearance(birds3.getImage());
bird.m_userData=this.getCharacterinfo();
bird.createFixture(characterfixdef);
下载地址:(打开后第一个)
更多资源请点击:
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:132346次
积分:1348
积分:1348
排名:千里之外
原创:48篇
评论:11条
(2)(10)(7)(27)(3)

参考资料

 

随机推荐