windows form c++ 编写的打砖块

Home Home
引用 | 编辑 s90304a123
2012-05-29 10:56
楼主
推文 x1
程式码真的太长了不太可能全贴在这里= =
以下展示球的类别方法及其属性
游戏中有道具跟碰撞侦测而且是clr form的程式应该挺容易学的^^"
有兴趣的人看看吧
完整程式码下载

using namespace System::Drawing;
using namespace System::Media;
#pragma once

namespace Breakit{

  static int CBallDiameter=20;
  static int CheckPointsBrick=20;
  static int HitScore;
  static int GameBrickCount;
  static int GameLife;
  static int GameTime;
  static int PropsBall=0;

public ref class ball
{
  static SoundPlayer ^PongBallHit;
  static bool PongBallHitOver;

public:
  int WindowRight,WindowDown;
  int x,y;
  int previousUp,previousDown,previousLeft,previousRight;
  int xspeed,yspeed;
  System::Random^ rand;

  ball()
  {
  xspeed=12,yspeed=-13;
  rand=gcnew System::Random;
  PongBallHit=gcnew SoundPlayer("sound\\PongBallHit.wav");
  PongBallHitOver=false;
  }

  public:

  void updatePoint()
  {
      previousUp=y,previousDown=y+CBallDiameter,previousLeft=x,previousRight=x+CBallDiameter;
  }

  void moving(System::Windows::Forms::PictureBox^ ball)
  {
      x+=xspeed;
      y+=yspeed;
      ball->Location = Point(x,y);
      ..

访客只能看到部份内容,免费 加入会员



献花 x3
引用 | 编辑 ebolaman
2012-05-29 23:23
1楼
  
貌似 Vista 或 Win7 会有这种问题 :

点程式时出现错误讯息 :

[Window Title]
C:\Users\user\Desktop\breakit\Breakit.exe

[Content]
C:\Users\user\Desktop\breakit\Breakit.exe

因为应用程式的并列组态错误,所以无法启动。如需详细资讯,请参阅应用程式事件日志。


[确定]


这是怎么一回事?

有安装过 vcredist_x86 却仍然冒出来

献花 x0
引用 | 编辑 s90304a123
2012-05-30 15:14
2楼
  
在我同学的WIN8上跑也是这样,.NET 3.5有装的话,那就要麻烦您载原始码自行编译啰表情

献花 x0
引用 | 编辑 iamboss123
2014-01-12 14:12
3楼
  
后面那个背景是怎么弄的!

献花 x0