【基于Java的超级玛丽游戏的设计与实现(效果,字节跳动Java三面凉凉

文章描述了一个游戏开发中的场景设置,涉及障碍物生成和敌人的添加,同时提及了Java程序员的成长路径,包括提供一份全面的学习资料清单,涵盖了算法、数据结构、数据库优化、并发编程和架构等内容,旨在帮助初级Java开发者提升技能。
摘要由CSDN通过智能技术生成

}

//绘制水管

this.allObstruction.add(new Obstruction(60, 540, 6,this));

this.allObstruction.add(new Obstruction(120, 540, 5,this));

this.allObstruction.add(new Obstruction(60, 480, 6,this));

this.allObstruction.add(new Obstruction(120, 480, 5,this));

this.allObstruction.add(new Obstruction(60, 420, 8,this));

this.allObstruction.add(new Obstruction(120, 420, 7,this));

this.allObstruction.add(new Obstruction(300, 540, 6,this));

this.allObstruction.add(new Obstruction(360, 540, 5,this));

this.allObstruction.add(new Obstruction(300, 480, 6,this));

this.allObstruction.add(new Obstruction(360, 480, 5,this));

this.allObstruction.add(new Obstruction(300, 420, 6,this));

this.allObstruction.add(new Obstruction(360, 420, 5,this));

this.allObstruction.add(new Obstruction(300, 360, 8,this));

this.allObstruction.add(new Obstruction(360, 360, 7,this));

//绘制怪物

this.allEnemy.add(new Enemy(330, 360, true, 2, 300, 420,this));

}

//第三个场景

if(sort==3){

for(int i=0;i<15;i++){

this.allObstruction.add(new Obstruction(i*60, 540, 9,this));

}

//绘制砖块和问号

this.allObstruction.add(new Obstruction(180, 360, 4,this));

this.allObstruction.add(new Obstruction(420, 360, 4,this));

this.allObstruction.add(new Obstruction(660, 360, 4,this));

this.allObstruction.add(new Obstruction(420, 180, 4,this));

}

//第四个场景

if(sort==4){

for(int i=0;i<15;i++){

if(i<2||i>12){

this.allObstruction.add(new Obstruction(i*60, 540, 9,this));

}

}

this.allObstruction.add(new Obstruction(120, 360, 0,this));

this.allObstruction.add(new Obstruction(180, 360, 0,this));

this.allObstruction.add(new Obstruction(300, 180, 0,this));

this.allObstruction.add(new Obstruction(360, 180, 0,this));

this.allObstruction.add(new Obstruction(420, 180, 0,this));

this.allObstruction.add(new Obstruction(480, 180, 0,this));

this.allObstruction.add(new Obstruction(540, 180, 0,this));

this.allObstruction.add(new Obstruction(660, 360, 0,this));

this.allObstruction.add(new Obstruction(720, 360, 0,this));

}

//第五个场景

if(sort==5){

int z = 2;

for(int i=0;i<15;i++){

if(i%2==0 && i<7){

this.allObstruction.add(new Obstruction(i60, 540-(i60), 9,this));

for(int x=i;x>0;x–){

this.allObstruction.add(new Obstruction(i60, 540-(x60)+60, 10,this));

}

}

if(i%2==0 && i>7){

this.allObstruction.add(new Obstruction(i*60, 540-((i-z)*60), 9,this));

for(int x=i-z;x>0;x–){

this.allObstruction.add(new Obstruction(i60, 540-(x60)+60, 10,this));

}

z+=4;

}

}

}

//第六个场景

if(sort==6){

for(int i=0;i<15;i++){

this.allObstruction.add(new Obstruction(i*60, 540, 9,this));

}

this.allObstruction.add(new Obstruction(480, 480, 1,this));

this.allObstruction.add(new Obstruction(480, 420, 1,this));

this.allObstruction.add(new Obstruction(480, 360, 1,this));

this.allObstruction.add(new Obstruction(480, 300, 1,this));

this.allObstruction.add(new Obstruction(480, 240, 1,this));

this.allObstruction.add(new Obstruction(480, 180, 1,this));

this.allObstruction.add(new Obstruction(540, 240, 1,this));

this.allObstruction.add(new Obstruction(540, 300, 1,this));

this.allObstruction.add(new Obstruction(540, 360, 1,this));

this.allObstruction.add(new Obstruction(540, 420, 1,this));

this.allObstruction.add(new Obstruction(540, 480, 1,this));

this.allObstruction.add(new Obstruction(600, 300, 1,this));

this.allObstruction.add(new Obstruction(600, 360, 1,this));

this.allObstruction.add(new Obstruction(600, 420, 1,this));

this.allObstruction.add(new Obstruction(600, 480, 1,this));

this.allObstruction.add(new Obstruction(660, 360, 1,this));

this.allObstruction.add(new Obstruction(660, 420, 1,this));

this.allObstruction.add(new Obstruction(660, 480, 1,this));

this.allObstruction.add(new Obstruction(720, 420, 1,this));

this.allObstruction.add(new Obstruction(720, 480, 1,this));

this.allObstruction.add(new Obstruction(780, 480, 1,this));

//通关要点,隐形砖块

this.allObstruction.add(new Obstruction(300, 360, 3,this));

}

//第七个场景

if(sort==7){

for(int i=0;i<15;i++){

this.allObstruction.add(new Obstruction(i*60, 540, 9,this));

}

this.allObstruction.add(new Obstruction(490, 180, 11,this));

this.allObstruction.add(new Obstruction(520, 480, 2,this));

//地上障碍物

this.allObstruction.add(new Obstruction(240, 360, 1,this));

this.allObstruction.add(new Obstruction(240, 420, 1,this));

this.allObstruction.add(new Obstruction(240, 480, 1,this));

this.allObstruction.add(new Obstruction(180, 420, 1,this));

this.allObstruction.add(new Obstruction(180, 480, 1,this));

this.allObstruction.add(new Obstruction(120, 480, 1,this));

}

}

//重置方法,重置障碍物和敌人

public void reset(){

//将移除的障碍物和敌人还原

this.allEnemy.addAll(this.removeEnemy);

this.allObstruction.addAll(this.removeObstruction);

//调用障碍物和敌人的重置方法

for(int i=0;i<this.allEnemy.size();i++){

this.allEnemy.get(i).reset();

}

for(int i=0;i<this.allObstruction.size();i++){

this.allObstruction.get(i).reset();

}

}

public BufferedImage getBgImage() {

return bgImage;

}

public List getAllObstruction() {

return allObstruction;

}

public List getRemoveObstruction() {

return removeObstruction;

}

public int getSort() {

return sort;

}

public List getAllEnemy() {

return allEnemy;

}

public List getRemoveEnemy() {

小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数初中级Java工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Java开发全套学习资料》送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频

如果你觉得这些内容对你有帮助,可以添加下面V无偿领取!(备注Java)
img

文末

我将这三次阿里面试的题目全部分专题整理出来,并附带上详细的答案解析,生成了一份PDF文档

  • 第一个要分享给大家的就是算法和数据结构

网易严选Java开发三面面经:HashMap+JVM+索引+消息队列

  • 第二个就是数据库的高频知识点与性能优化

网易严选Java开发三面面经:HashMap+JVM+索引+消息队列

  • 第三个则是并发编程(72个知识点学习)

网易严选Java开发三面面经:HashMap+JVM+索引+消息队列

  • 最后一个是各大JAVA架构专题的面试点+解析+我的一些学习的书籍资料

网易严选Java开发三面面经:HashMap+JVM+索引+消息队列

还有更多的Redis、MySQL、JVM、Kafka、微服务、Spring全家桶等学习笔记这里就不一一列举出来

.(img-ZvxT8F0u-1711163351853)]

  • 第二个就是数据库的高频知识点与性能优化

[外链图片转存中…(img-WISWd30t-1711163351853)]

  • 第三个则是并发编程(72个知识点学习)

[外链图片转存中…(img-Zh1m1jeU-1711163351854)]

  • 最后一个是各大JAVA架构专题的面试点+解析+我的一些学习的书籍资料

[外链图片转存中…(img-g6HmO903-1711163351854)]

还有更多的Redis、MySQL、JVM、Kafka、微服务、Spring全家桶等学习笔记这里就不一一列举出来

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值