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