融入动画技术的小游戏——“生存或创造?”

游戏简介

本游戏是基于Processing的一款融入了动画技术的交互应用,游戏操作简单,界面简洁直观,易上手,可玩性高。

创意来源

游戏思路是来源于是一个检测飞行员反应能力的小游戏,但是其模式单一,目的知识检测反应能力。所以在此之上,我想制作一个游戏既能够提高反应能力,又能够加入自己的想法实现一些创作;即使当游戏结束时也能在游戏中看到自己创作的乐趣。

玩法介绍

当玩家点击开始界面的小圆球时即开始游戏,首先,你得保证自己的小球不会越出界限,并不会被敌人追上;其次敌人会留下色彩的痕迹,你可以在躲避之余进行创作。

游戏演示效果

游戏动图
在这里插入图片描述

主要技术说明

  • 主函数
    主函数:建立画布,布置初始画面和一些其他情况的画面,创建玩家与敌人,增加死亡和开始游戏的判定,确定暂停,死亡等多种情况。
    主函数源代码
void setup() {
  size(800, 800);
   a = new player();
  v = new Vehicle(width/2, height/2);
  ps = new ParticleSystem(new PVector(-500,-500),5);
  frameRate(100);
}

void draw() {
  background(255);
  PVector mouse = new PVector(mouseX, mouseY);
  a.drag();
  a.hover(mouseX,mouseY);
  a.display();

  // Draw an ellipse at the mouse position
    stroke(175);
    noFill();
    rectMode(CENTER);
    rect(width/2, height/2, width-d*2, height-d*2);
    
    ps.origin.set(mouseX,mouseY,0);    
    ps.addParticle(5);
    if(v.isdie==true){  
      textSize(100);
      text(t, width/2, height/2);
    }
  // Call the appropriate steering behaviors for our agents
  if(!mousePressed)
  {
    if(v.isdie==false){
      if(isfirst==true){
      v.display();
      textSize(15);
      text("click the circle to begin", width/2-80, height/2+350);
      textSize(80);
      text("survive?", width/2-300, height/2-250);
      text("create?", width/2+50, height/2-50);
      text("or", width/2-50, height/2-150);
    
    }
      if(isfirst==false){
      textSize(20);
      v.display();
      text("click the circle to continue", width/2, height/2+350);}
  }
    if(v.isdie==true){
       v.display();
      textSize(30);
      text("Restart the game", width/2, height/2+350);}
}
          
  if(mousePressed)
  {
     v.seek(mouse);
  v.arrive(mouse);
  v.update();
  v.displ
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值