BBasic-Beats!

本文介绍了一款基于BBasic平台的音乐节奏类游戏Beats,详细阐述了游戏的主页设计、帮助说明、设置选项、游戏模式选择及游戏流程。包括从加载资源到游戏设置,再到游戏玩法的各个环节。
音乐节奏类游戏。
就像PSP中的Project DIVA、Android中的乐动舞指、ios中的节奏大师一样
然而,我们忽略了一个重要的平台——BBasic。
于是乎、

历经N天的努力,基于BBasic平台的游戏Beats产生了!

dimk,ctr,mok,mot,penx,peny,ctr,n,s1,s2,s3,s4,i1,hard,time,count,i2
  dimmstar,mfree,mhard,mchoose1,mchoose2,chopic1,chopic2,count,mcou

  dim grow,exc,aver,mpage

  hard=10

 

time=0'-----loadres----

chopic1=loadres("Beats\beats.lib",1)

chopic2=loadres("Beats\beats.lib",2)

homepic=loadres("Beats\beats.lib",3)

iconpic=loadres("Beats\beats.lib",4)

helppic=loadres("Beats\beats.lib",5)

pagepic=loadres("Beats\beats.lib",6)

scorepic=loadres("Beats\beats.lib",7)

,--------read sav-------

open "Beats\beats.sav" for binaryas #1

get #1,mstar

get #1,mfree

get #1,mhard

get #1,count

get #1,grow

get #1,exc

get #1,aver

get #1,mpage

if lof(1)=0 then

  mhard=1

  mstar=0

  mfree=0

  count=20

  grow=0

  aver=0

  exc=0

  mpage=0

end if

close #1

'-----

 

 

ctr=0

i1=0

mot=0

n=5

showpic(-1,homepic,0,0,240,320,0,0,1)

while n>0

if keypress(key_enter) then

 ifmstar=0 then

  goto 004

 else

  goto 001

  endif

else if keypress(key_escape) then

 end

end if

wend

'------主页-------

004 cls

showpic(-1,iconpic,0,0,240,100,0,0,1)

font(font_16hei)

pixlocate(88,128)

print"开始游戏"

pixlocate(88,160)

print"帮助说明"

pixlocate(88,192)

print"游戏设置"

pixlocate(88,224)

print"退出游戏"

k=waitkey()

penx=getpenposx(k)

peny=getpenposy(k)

if penx>=88 and penx<=152 then

  ifpeny>=128 and peny<=144 then

    goto 001

 else if peny>=160 and peny<=176 then

    goto 005

  else if peny>=192 and peny<=208 then

    goto 009

 else if peny>=224 and peny<=240 then

    end

 else

    goto 004

  endif

else

 goto 004

end if

'--------帮助-------

005 k=0

penx=0

peny=0

cls

showpic(-1,helppic,0,0,240,320,0,0,1)

pixlocate(0,220)

font(font_12hei)

print"由于BBasic限制,无法加载音乐,使用本软件"

print"时请先启动音乐。"

print""

print"版本:"

print"Ver 3.3"

print"Beats:音乐节奏类游戏"

font(font_16hei)

pixlocate(0,304)

print"返回"

k=0

penx=0

peny=0

k=waitkey()

penx=getpenposx(k)

peny=getpenposy(k)

if penx>=0 and penx<=32 then

   ifpeny>=304 and peny<=320 then

     goto 004

  end if

else

  cls

 goto 005

end if'-------change-------

009 cls

font(font_16hei)

print

print"Beats"

pixlocate(20,50)

print"快速启动"

font(font_12hei)

pixlocate(20,72)

print"取消开始菜单。"

font(font_16hei)

pixlocate(20,104)

print"自由模式"

font(font_12hei)

pixlocate(20,126)

print"取消Beats数量限制。"

font(font_16hei)

pixlocate(0,145)

print"困难程度"

pixlocate(20,170)

print"容易"

pixlocate(20,190)

print"中等"

pixlocate(20,210)

print"使用边框"

pixlocate(0,240)

print"Beats数量设置"

pixlocate(200,294)

print"返回"

if mstar=0 then

 showpic(-1,chopic1,0,45,20,20,0,0,1)

else if mstar=1 then

 showpic(-1,chopic2,0,45,20,20,0,0,1)

end if

if mfree=0 then

 showpic(-1,chopic1,0,99,20,20,0,0,1)

else if mfree=1 then

 showpic(-1,chopic2,0,99,20,20,0,0,1)

end if

if mhard=1 then

 showpic(-1,chopic2,0,165,20,20,0,0,1)

 showpic(-1,chopic1,0,185,20,20,0,0,1)

else if mhard=2 then

 showpic(-1,chopic1,0,165,20,20,0,0,1)

 showpic(-1,chopic2,0,185,20,20,0,0,1)

end if

if mpage=0 then

 showpic(-1,chopic2,0,205,20,20,0,0,1)

else if mpage=1 then

 showpic(-1,chopic1,0,205,20,20,0,0,1)

end if

k=waitkey()

penx=getpenposx(k)

peny=getpenposy(k)

if penx>=0 and penx<=20 then

   ifpeny>=45 and peny<=65 then

    if mstar=0 then

       mstar=1

       showpic(-1,chopic2,0,45,20,20,0,0,1)

cls

goto 009

 

    else if mstar=1 then

       mstar=0

       showpic(-1,chopic1,0,45,20,20,0,0,1)

cls

goto 009

 

    end if

 else if peny>=110 and peny<=130 then

 ifmfree=0 then

 mfree=1

 showpic(-1,chopic2,0,99,20,20,0,0,1)

cls 

goto 009

 elseif mfree=1 then

 mfree=0

 showpic(-1,chopic1,0,99,20,20,0,0,1)

 cls

 goto009

 endif

 elseif peny>=165 and peny<=185 then

 mhard=1

 cls

 goto009

 elseif peny>=185 and peny<=205 then

 mhard=2

 cls

 goto009

else if peny>=205 and peny<=225 then

   ifmpage=0 then

  mpage=1

  cls

  goto 009

  else if mpage=1 then

  mpage=0

  cls

  goto 009

  end if

 else

 goto 009

 endif

else if penx>=0 and penx<=96 then

  ifpeny>=240 and peny<=256 then

 mcou=1

 goto 010

 else

  goto 009

  endif

else if penx>=0 and penx<=240 then

  ifpeny>=304 and peny<=320 then

 i1=0

 i2=0

  i=0

 open "Beats\beats.sav" for binary as #2

  put#2,mstar

  put#2,mfree

  put#2,mhard

  put#2,count

  put#2,grow

  put#2,exc

  put#2,aver

  put#2,mpage

 close #2

   goto 004

 else

   goto 009

  endif

else

  goto 009

end if

010 cls

if mcou=1 then

 font(font_16hei)

 print"Beats数量设置"

 print"当前Beats数量"+count

 font(font_16hei)

 pixlocate(0,296)

 print"清除"

 pixlocate(64,296)

 print"+50"

 pixlocate(120,296)

 print"+100"

 pixlocate(192,296)

 print"完成"

k=waitkey()

penx=getpenposx(k)

peny=getpenposy(k)

if peny>=296 and peny<=320 then

  ifpenx>=0 and penx<=48 then

   count=0

   cls

   goto 010

 else if penx>=64 and penx<=100 then

  count=count+50

  cls

  goto 010

 else if penx>=120 and penx<=150 then

 count=count+100

  cls

 goto 010

 else if penx>=192 and penx<=240 then

  cls

 mcou=0

 goto 009

 else

  cls

  goto 010

  endif

else

  cls

 goto 010

end if

end if

 

 

 

001 cls

k=0

penx=0

peny=0

ctr=rnd(900)

if ctr>=0 and ctr<100 then

  mok=1

else if ctr>=100 and ctr<200 then

  mok=2

else if ctr>=200 and ctr<=300 then

  mok=3

else if ctr>=300 and ctr<400 then

  mok=4

else if ctr>=400 and ctr<500 then

  mok=5

else if ctr>=500 and ctr<600 then

  mok=6

else if ctr>=600 and ctr<700 then

  mok=7

else if ctr>=700 and ctr<800 then

  mok=8

else if ctr>=800 and ctr<900 then

  mok=9

end if

'------屏幕显示-----

002 if mpage=0 then

showpic(-1,pagepic,0,0,240,240,0,0,1)

else if mpage=1 then

 goto 012

end if

012 if mok=1 then

fillpage(-1,0,0,80,80,&hff0000)

else if mok=2 then

fillpage(-1,80,0,80,80,&h00ffff)

else if mok=3 then

fillpage(-1,160,0,80,80,&h0000ff)

else if mok=4 then

fillpage(-1,0,80,80,80,&h00ffff)

else if mok=5 then

fillpage(-1,80,80,80,80,&h00ff00)

else if mok=6 then

fillpage(-1,160,80,80,80,&h0000ff)

else if mok=7 then

fillpage(-1,0,160,80,80,&hffffff)

else if mok=8 then

fillpage(-1,80,160,80,80,&h00ffff)

else if mok=9 then

fillpage(-1,160,160,80,80,&h00ff00)

end if

if mfree=0 then

fillpage(-1,0,290,i2,6,&hffffff)

font(font_12hei)

pixlocate(0,275)

print"进度:"+i1+"/"+count

else if mfree=1 then

font(font_12hei)

pixlocate(0,285)

print"自由模式"

end if

font(font_16hei)

pixlocate(0,304)

print"返回"

 

'-------触点坐标-------

k=0

penx=0

peny=0

011 k=waitkey()

penx=getpenposx(k)

peny=getpenposy(k)

if peny>=0 and peny<80 then

   ifpenx>=0 and penx<80 then

   mot=1

   goto 003

  else if penx>=80 and penx<160 then

   mot=2

   goto 003

  else if penx>=160 and penx<240 then

   mot=3

   goto 003

  end if

else if peny>=80 and peny<160 then

   ifpenx>=0 and penx<80 then

  mot=4

  goto 003

  else if penx>=80 and penx<160 then

  mot=5

  goto 003

  else if penx>=160 and penx<240 then

  mot=6

  goto 003

  end if

else if peny>=160 and peny<240 then

   ifpenx>=0 and penx<80 then

  mot=7

  goto 003

  else if penx>=80 and penx<160 then 

  mot=8

  goto 003

  else if penx>=160 and penx<240 then

  mot=9

  goto 003

  end if

else if peny>=304 and peny<=320 then

   if penx>=0 and penx<=32 then

     

     

    

    if mfree=0 then

 i=0

 i1=0

 i2=0

     goto 004

    else if mfree=1 then

     showpic(-1,scorepic,0,0,240,240,0,0,1)

 font(font_12hei)

 grow=grow+i

 exc=exc+1

     pixlocate(0,80)

     print"自由模式"

     print""

     print"本次游戏共进行"+i1+"个Beats。"

     print"Beats"+i+"个。"

     print""

     print"增加成就值:"+i+"分。"

     print""

     print"-----------------------------------------"

     print"信息"

     print"-----------------------------------------"

     print""

     print"共进行游戏"+exc+"次。"

     print"成就值共"+grow+"分。"

     print""

     aver=grow/exc

     print"平均成就值"+aver+"分。"

i=0

i1=0

i2=0

waitkey()

cls

goto 004

end if

   end if

end if

'------判断坐标--------

003 if mfree=0 then

i2=240/count*i1

fillpage(-1,0,290,i2,6,&hffffff)

if mok=mot then

 i=i+1

 i1=i1+1

 mot=0

 cls

if i1=count then

 goto 007

else

 goto001

end if

else

  cls

 mot=0

 i1=i1+1

 goto 001

end if   

else if mfree=1 then

  ifmot=mok then

   i=i+1

   i1=i1+1

   mot=0

   cls

  goto 001

 else

  i1=i1+1

  mot=0

  cls

  goto 001

  endif

end if

007 cls

 font(font_12hei)

  showpic(-1,scorepic,0,0,240,240,0,0,1)

 grow=grow+i

 exc=exc+1

 pixlocate(0,80)

  print"共"+count+"个Beats。"

  print""

  print"Beats"+i+"个。"

 print"增加成就值"+i+"分。"

 print""

 print"---------------------------------------------"

 print"信息"

 print"---------------------------------------------"

 print""

 print"共进行游戏"+exc+"次。"

 print"成就值共"+grow+"分。"

 aver=grow/exc

 print

 print"平均成就值"+aver+"分。"

  i1=0

  i=0

  i2=0

  waitkey()

  goto 004

end if 
运行结果:

 










@ Mayuko

【语音分离】基于平均谐波结构建模的无监督单声道音乐声源分离(Matlab代码实现)内容概要:本文介绍了基于平均谐波结构建模的无监督单声道音乐声源分离方法,并提供了相应的Matlab代码实现。该方法通过对音乐信号中的谐波结构进行建模,利用音源间的频率特征差异,实现对混合音频中不同乐器或人声成分的有效分离。整个过程无需标注数据,属于无监督学习范畴,适用于单通道录音场景下的语音与音乐分离任务。文中强调了算法的可复现性,并附带完整的仿真资源链接,便于读者学习与验证。; 适合人群:具备一定信号处理基础和Matlab编程能力的高校学生、科研人员及从事音频处理、语音识别等相关领域的工程师;尤其适合希望深入理解声源分离原理并进行算法仿真实践的研究者。; 使用场景及目标:①用于音乐音频中人声与伴奏的分离,或不同乐器之间的分离;②支持无监督条件下的语音处理研究,推动盲源分离技术的发展;③作为学术论文复现、课程项目开发或科研原型验证的技术参考。; 阅读建议:建议读者结合提供的Matlab代码与网盘资料同步运行调试,重点关注谐波建模与频谱分解的实现细节,同时可扩展学习盲源分离中的其他方法如独立成分分析(ICA)或非负矩阵分解(NMF),以加深对音频信号分离机制的理解。
内容概要:本文系统介绍了新能源汽车领域智能底盘技术的发展背景、演进历程、核心技术架构及创新形态。文章指出智能底盘作为智能汽车的核心执行层,通过线控化(X-By-Wire)和域控化实现驱动、制动、转向、悬架的精准主动控制,支撑高阶智能驾驶落地。技术发展历经机械、机电混合到智能三个阶段,当前以线控转向、线控制动、域控制器等为核心,并辅以传感器、车规级芯片、功能安全等配套技术。文中还重点探讨了“智能滑板底盘”这一创新形态,强调其高度集成化、模块化优势及其在成本、灵活性、空间利用等方面的潜力。最后通过“2025智能底盘先锋计划”的实车测试案例,展示了智能底盘在真实场景中的安全与性能表现,推动技术从研发走向市场验证。; 适合人群:汽车电子工程师、智能汽车研发人员、新能源汽车领域技术人员及对智能底盘技术感兴趣的从业者;具备一定汽车工程或控制系统基础知识的专业人士。; 使用场景及目标:①深入了解智能底盘的技术演进路径与系统架构;②掌握线控技术、域控制器、滑板底盘等关键技术原理与应用场景;③为智能汽车底盘研发、系统集成与技术创新提供理论支持与实践参考。; 阅读建议:建议结合实际车型和技术标准进行延伸学习,关注政策导向与行业测试动态,注重理论与实车验证相结合,全面理解智能底盘从技术构想到商业化落地的全过程。
【顶级EI复现】计及连锁故障传播路径的电力系统 N-k 多阶段双层优化及故障场景筛选模型(Matlab代码实现)内容概要:本文介绍了名为《【顶级EI复现】计及连锁故障传播路径的电力系统 N-k 多阶段双层优化及故障场景筛选模型(Matlab代码实现)》的技术资源,重点围绕电力系统中连锁故障的传播路径展开研究,提出了一种N-k多阶段双层优化模型,并结合故障场景筛选方法,用于提升电力系统在复杂故障条件下的安全性与鲁棒性。该模型通过Matlab代码实现,具备较强的工程应用价值和学术参考意义,适用于电力系统风险评估、脆弱性分析及预防控制策略设计等场景。文中还列举了大量相关的科研技术支持方向,涵盖智能优化算法、机器学习、路径规划、信号处理、电力系统管理等多个领域,展示了广泛的仿真与复现能力。; 适合人群:具备电力系统、自动化、电气工程等相关背景,熟悉Matlab编程,有一定科研基础的研究生、高校教师及工程技术人员。; 使用场景及目标:①用于电力系统连锁故障建模与风险评估研究;②支撑高水平论文(如EI/SCI)的模型复现与算法验证;③为电网安全分析、故障传播防控提供优化决策工具;④结合YALMIP等工具进行数学规划求解,提升科研效率。; 阅读建议:建议读者结合提供的网盘资源,下载完整代码与案例进行实践操作,重点关注双层优化结构与场景筛选逻辑的设计思路,同时可参考文档中提及的其他复现案例拓展研究视野。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值