導航:首頁 > 源碼編譯 > 爆點娛樂游戲源碼

爆點娛樂游戲源碼

發布時間:2024-05-10 07:03:20

① vb小游戲源代碼

Rem 窗體創建三個單選框按鈕,Option1、Option2、Option3。

小游戲是一個較模糊的概念,它是相對於體積龐大的單機游戲及網路游戲而言的,泛指所有體積較小、玩法簡單的游戲,通常這類游戲以休閑益智類為主,有單機版有網頁版,在網頁上嵌入的多為FLASH格式。

當下小游戲主要是指在線玩的flash版本游戲,統稱小游戲,其實小游戲還包含單機游戲,小型游戲機等。一般游戲大小小於10m的游戲都統稱為小游戲,一些街機類小游戲。因其游戲安裝簡便,耐玩性強,無依賴性而廣受白領及小朋友的喜愛。

小游戲」這個詞的型含義其實很簡單,它不是一些大的游戲,不必花費更多的時間和精力。

小游戲是原始的游戲娛樂方式,小游戲本身是為了叫人們在工作,學習後的一種娛樂、休閑的一種方式,不是為了叫玩家為之花費金錢、花費精力,更不是叫玩家為他痴迷。

小游戲也可以理解為「Flash游戲」,是以SWF為後綴的游戲的總稱.這些游戲是通過Flash軟體和 Flash 編程語言 Flash ActionScript 製作而成。

由於Flash是矢量軟體,所以小游戲放大後幾乎不影響畫面效果。Flash小游戲是一種新興起的游戲形式,以游戲簡單,操作方便,綠色,無需安裝,文件體積小等優點漸漸被廣大網友喜愛。

② 娓告垙浠g爜濡備綍鑾峰彇

鍦ㄦ父鎴忓紑鍙戦嗗煙涓錛屾父鎴忎唬鐮佹槸闈炲父閲嶈佺殑涓閮ㄥ垎銆傛父鎴忎唬鐮佹槸娓告垙瀹炵幇鐨勬牳蹇冿紝鍖呮嫭娓告垙閫昏緫銆佹父鎴忕晫闈㈠拰娓告垙瑙勫垯絳夈傚洜姝わ紝璁稿氭父鎴忓紑鍙戣呭拰鐜╁墮兘甯屾湜鑳藉熻幏鍙栨父鎴忎唬鐮侊紝浠ヤ究榪涜屼慨鏀廣佷紭鍖栧拰鎵╁睍銆傞偅涔堬紝娓告垙浠g爜濡備綍鑾峰彇鍛錛熸湰鏂囧皢涓哄ぇ瀹朵粙緇嶅嚑縐嶅父瑙佺殑鑾峰彇娓告垙浠g爜鐨勬柟娉曘
涓銆佸紑婧愭父鎴忎唬鐮
寮婧愭父鎴忔槸鎸囨父鎴忓紑鍙戣呭皢娓告垙浠g爜瀹屽叏寮鏀劇粰鍏浼楋紝浠諱綍浜洪兘鍙浠ヤ笅杞姐佷嬌鐢ㄣ佷慨鏀瑰拰鍒嗕韓銆傚湪寮婧愭父鎴忎腑錛屾父鎴忎唬鐮侀氬父鎵樼″湪GitHub絳変唬鐮佹墭綆″鉤鍙頒笂銆傚紑婧愭父鎴忕殑濂藉勬槸鍙浠ヨ╂洿澶氱殑浜哄弬涓庡埌娓告垙寮鍙戜腑鏉ワ紝鍏卞悓瀹屽杽娓告垙錛屽苟涓斿彲浠ラ伩鍏嶇増鏉冪籂綰楓
浜屻侀嗗悜宸ョ▼
閫嗗悜宸ョ▼鏄鎸囬氳繃鍙嶆眹緙栥佽皟璇曠瓑鎵嬫碉紝灝嗗凡緙栬瘧鐨勭▼搴忚漿鍖栦負鍙璇葷殑婧愪唬鐮併傞氳繃閫嗗悜宸ョ▼鍙浠ヨ幏鍙栨父鎴忕殑婧愪唬鐮侊紝浣嗚繖縐嶆柟娉曢渶瑕佷竴瀹氱殑鎶鏈鍔熷簳鍜屾椂闂存垚鏈錛屽苟涓斿彲鑳戒細瀛樺湪娉曞緥椋庨櫓銆
涓夈佹父鎴忓紑鍙戣呮彁渚
濡傛灉娓告垙寮鍙戣呮効鎰忔彁渚涙父鎴忎唬鐮侊紝鍒欏彲浠ョ洿鎺ュ悜寮鍙戣呯儲鍙栥備竴浜涚嫭絝嬪紑鍙戣呮垨灝忓洟闃熷彲鑳戒細縐鏋佹彁渚涙父鎴忎唬鐮侊紝浠ュ惛寮曟洿澶氱殑鐢ㄦ埛鍜屽紑鍙戣呭弬涓庡埌娓告垙寮鍙戜腑鏉ャ備絾鏄錛屽ぇ澶氭暟鍟嗕笟娓告垙寮鍙戣呬笉浼氭彁渚涙父鎴忎唬鐮侊紝鍥犱負榪欐牱鍙鑳戒細娉勯湶娓告垙鏈哄瘑鎴栬呬鏡鐘鐗堟潈絳夐棶棰樸
緇間笂鎵榪幫紝鑾峰彇娓告垙浠g爜鐨勬柟娉曚富瑕佹湁寮婧愭父鎴忎唬鐮併侀嗗悜宸ョ▼鍜屾父鎴忓紑鍙戣呮彁渚涚瓑銆備絾鏄錛屽湪鑾峰彇娓告垙浠g爜鏃訛紝闇瑕佹敞鎰忕増鏉冨拰娉曞緥闂棰橈紝閬垮厤渚電姱浠栦漢鐨勬潈鐩娿傚傛灉鎮ㄦ兂瑕佸︿範娓告垙緙栫▼錛屽彲浠ラ夋嫨鍙傝冨紑婧愭父鎴忎唬鐮佽繘琛屽︿範錛屾垨鑰呭弬鍔犳父鎴忓紑鍙戣呯殑鍩硅鍜屼氦嫻佹椿鍔ㄣ

③ 游戲軟體怎麼查看源代碼

源代碼是看不成的,因為游戲軟體打包好做成app的話,是沒法看源碼的,雖然存在一些特殊情況下,我們可以推測出exe程序是用什麼程序寫的。但是多數情況下,我們是無法只根據一個exe程序就判斷出來的。

根據exe程序我們是無法直接得到程序的源碼的。雖然也有一些用於逆向工程的辦法,但那不可能把已經是exe的程序反回到它原始的源碼情況。而且這些工具都很難用。你可以用「反編譯」搜到很多工具,但是說實話,即便是這方面的專家,要看懂反編譯以後的程序也不是一件輕松的事情。

④ 哪個網站有。所有所有游戲的源代碼

您好,現在很多網站都可以查詢到游戲的源代碼。
例如17171、u9、766都是可以進行相關查詢的。
源代碼(也稱源程序)是指未編譯的按照一定的程序設計語言規范書寫的文本文件,是一系列人類可讀的計算機語言指令。
在現代程序語言中,源代碼可以是以書籍或者磁帶的形式出現,但最為常用的格式是文本文件,這種典型格式的目的是為了編譯出計算機程序。

⑤ 誰能給我一個手機游戲的源代碼啊

這個地址也有,不過直接給你吧,這樣比較好
先給你看看主要的類吧

package Game;

import DreamBubbleMidlet;

import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;

import javax.microedition.lci.Graphics;
import javax.microedition.lci.Image;
import javax.microedition.lci.game.GameCanvas;
import javax.microedition.lci.game.LayerManager;
import javax.microedition.lci.game.Sprite;

public class Game extends GameCanvas implements Runnable {

protected DreamBubbleMidlet dreamBubbleMidlet;

protected Graphics g;
protected Image loadingImage;
protected Image pauseImage;
protected Image cursorImage;
protected Image jackStateImage;
protected Image johnStateImage;
protected Image numberImage;

protected Sprite cursor;
protected Sprite number;
protected LayerManager cursorManager;
protected LayerManager numberManager;

protected Hashtable bombTable;
protected Map map;
protected LayerManager gameLayerManager;
protected Role player;
protected Sprite playerGhost;

protected int screenWidth;
protected int screenHeight;
protected int delay = 50;
protected int[][] bornPlace;
protected int chooseIndex;
protected int stageIndex = 1;
protected int gameClock;
protected int loadPercent;

protected boolean isPause;
protected boolean isEnd;
protected boolean isPlaying;
protected boolean isLoading;

protected Thread mainThread;

public Game(DreamBubbleMidlet dreamBubbleMidlet) {
super(false);
this.setFullScreenMode(true);
this.dreamBubbleMidlet = dreamBubbleMidlet;

this.screenWidth = this.getWidth();
this.screenHeight = this.getHeight();

try {
this.loadingImage = Image.createImage("/Game/Loading.png");
this.pauseImage = Image.createImage("/Game/Pause.png");
this.cursorImage = Image.createImage("/Game/Cursor.png");
this.jackStateImage = Image.createImage("/State/JackState.png");
this.johnStateImage = Image.createImage("/State/JohnState.png");
this.numberImage = Image.createImage("/State/Number.png");
} catch (IOException e) {
e.printStackTrace();
}

this.g = this.getGraphics();
}

public void loadStage(int stage) {
this.isEnd = false;
this.isPause = false;
this.isPlaying = false;
this.gameLayerManager = new LayerManager();
this.cursorManager = new LayerManager();
this.numberManager = new LayerManager();
this.bombTable = new Hashtable();
this.cursor = new Sprite(this.cursorImage, 32, 32);
this.number = new Sprite(this.numberImage, 12, 10);
this.loadPercent = 20;
sleep();

loadMap(stage);
this.loadPercent = 40;
sleep();

loadPlayer();
this.loadPercent = 60;
sleep();

this.gameLayerManager.append(map.getBombLayer());
this.gameLayerManager.append(map.getBuildLayer());
this.gameLayerManager.append(map.getToolLayer());
this.gameLayerManager.append(map.getFloorLayer());
this.gameLayerManager.setViewWindow(0, -5, screenWidth,
Global.MAP_HEIGHT + 5);
this.cursorManager.append(cursor);
this.numberManager.append(number);
this.loadPercent = 80;
sleep();

this.loadPercent = 100;
sleep();
isPlaying = true;
}

public void run() {
while (!isEnd) {
long beginTime = System.currentTimeMillis();
this.drawScreen();
long endTime = System.currentTimeMillis();
if (endTime - beginTime < this.delay) {
try {
Thread.sleep(this.delay - (endTime - beginTime));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}

public void loadMap(int stage) {
switch (stage) {
case 0:
this.map = new Map(Global.MAP_BLOCK);
this.bornPlace = Global.MAP_BLOCK_BORNPLACE;
break;
case 1:
this.map = new Map(Global.MAP_FACTORY);
this.bornPlace = Global.MAP_FACTORY_BORNPLACE;
break;
case 2:
this.map = new Map(Global.MAP_FOREST);
this.bornPlace = Global.MAP_FOREST_BORNPLACE;
break;
case 3:
this.map = new Map(Global.MAP_PIRATE);
this.bornPlace = Global.MAP_PIRATE_BORNPLACE;
break;
case 4:
this.map = new Map(Global.MAP_FAUBOURG);
this.bornPlace = Global.MAP_FAUBOURG_BORNPLACE;
break;
}
}

public void loadPlayer() {
this.player = SingleGameRole.createSingleGameRole(this, Global.JACK,
this.bornPlace[0][0], this.bornPlace[0][1]);
this.gameLayerManager.append(player);
try {
this.playerGhost = new Sprite(Image.createImage("/Character/Jack.png"),
this.player.width, this.player.height);
this.gameLayerManager.append(playerGhost);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

public void playerUpdate() {
if(!this.player.isAlive)
this.playerGhost.setVisible(false);
this.playerGhost.setFrame(this.player.getFrame());
this.player.updateRole();
}

public void bombUpdate() {
Enumeration enu = this.bombTable.keys();
while (enu.hasMoreElements()) {
String key = (String) enu.nextElement();
Bomb bomb = (Bomb) (bombTable.get(key));

if (bomb.isvisable) {
bomb.update();
} else {
bombTable.remove(key);
bomb = null;
}
}
}

public void mapUpdate() {
this.map.update();
}

public void drawScreen() {
if (gameClock < 10000)
gameClock++;
else
gameClock = 0;
if (!this.isLoading) {
if (!isPause) {
this.operate();
this.bombUpdate();
this.playerUpdate();
this.mapUpdate();
g.setColor(0x000000);
g.fillRect(0, 0, getWidth(), getHeight());
this.drawState();
gameLayerManager.paint(g, 0, this.screenHeight
- Global.MAP_HEIGHT - 5);
} else {
this.drawPauseFrame();
}
} else {
this.drawLoadingFrame();
}
this.flushGraphics();
}

public void drawFailScreen() {

}

public void drawState() {
if (this.player.type == Global.JACK) {
g.drawImage(jackStateImage, 60, 5, Graphics.TOP | Graphics.LEFT);
}
if (this.player.type == Global.JOHN) {
g.drawImage(johnStateImage, 60, 5, Graphics.TOP | Graphics.LEFT);
}

this.number.setFrame(this.player.bombNums);
this.numberManager.paint(g, 101, 15);
this.number.setFrame(this.player.speed);
this.numberManager.paint(g, 133, 15);
this.number.setFrame(this.player.power);
this.numberManager.paint(g, 165, 15);
}

protected void drawPauseFrame() {
g.setColor(0x000000);
g.fillRect(0, 0, getWidth(), getHeight());
this.drawState();
if (gameClock % 5 == 0)
this.cursor.setFrame((this.cursor.getFrame() + 1) % 4);
this.gameLayerManager.paint(g, 0, this.screenHeight - Global.MAP_HEIGHT
- 5);
this.cursorManager.paint(g, screenWidth / 2 - pauseImage.getWidth() / 2
- 32, screenHeight / 2 - pauseImage.getHeight() / 2
+ this.chooseIndex * 33 + 24);
g.drawImage(pauseImage, screenWidth / 2, screenHeight / 2,
Graphics.HCENTER | Graphics.VCENTER);
}

protected void drawLoadingFrame() {
g.setColor(66, 70, 246);
g.fillRect(0, 0, screenWidth, screenHeight);

g.drawImage(loadingImage, screenWidth / 2, 2 * screenHeight / 5,
Graphics.HCENTER | Graphics.VCENTER);

g.setColor(0, 255, 0);
g.fillRect((screenWidth - 120) / 2, 2 * screenHeight / 3,
(this.loadPercent * 120) / 100, 10);

g.setColor(255, 0, 0);
g.drawRect((screenWidth - 120) / 2, 2 * screenHeight / 3, 120, 10);
}

public void showMe() {
new Loading(this.stageIndex);
if (this.mainThread == null) {
mainThread = new Thread(this);
mainThread.start();
}
this.dreamBubbleMidlet.show(this);
}

public void operate() {
int keyStates = getKeyStates();
this.playerGhost.setPosition(this.player.xCoodinate, this.player.yCoodinate);
if ((keyStates & DOWN_PRESSED) != 0) {
this.player.walk(Global.SOUTH);
} else {
if ((keyStates & UP_PRESSED) != 0) {
this.player.walk(Global.NORTH);
} else {
if ((keyStates & RIGHT_PRESSED) != 0) {
this.player.walk(Global.EAST);
} else {
if ((keyStates & LEFT_PRESSED) != 0) {
this.player.walk(Global.WEST);
}
}
}
}
}

protected void keyPressed(int key) {
if (!this.isPlaying)
return;
if (!this.isPause && key == -7) {// 右鍵
this.chooseIndex = 0;
this.pauseGame();
return;
}
if (key == 35) {// #鍵
this.nextStage();
return;
}
if (key == 42) {// *鍵
this.preStage();
return;
}
if (this.isPause) {
switch (key) {
case -1:
case -3:
if (this.chooseIndex == 0)
this.chooseIndex = 2;
else
this.chooseIndex = (this.chooseIndex - 1) % 3;
break;
case -2:
case -4:
this.chooseIndex = (this.chooseIndex + 1) % 3;
break;
case -5:// 確認鍵
case -6:// 左軟鍵
switch (chooseIndex) {
case 0:
this.continueGame();
break;
case 1:
this.restart();
break;
case 2:
this.endGame();
break;
}
break;
default:
break;
}
} else {
switch (key) {
case 53:
case -5:// 確認鍵
this.player.setBomb(this.player.getRow(), this.player.getCol());
break;
}
}
}

public void restart() {
new Loading(this.stageIndex);
}

public void continueGame() {
this.isPause = false;
this.player.play();
}

public void pauseGame() {
this.isPause = true;
this.player.stop();
}

public void endGame() {
this.isEnd = true;
this.mainThread = null;
System.gc();
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this.dreamBubbleMidlet.menu.showMe();
}

public void nextStage() {
if (this.stageIndex < 4) {
this.stageIndex++;
}
new Loading(this.stageIndex);
}

public void preStage() {
if (this.stageIndex > 0) {
this.stageIndex--;
}
new Loading(this.stageIndex);
}

class Loading implements Runnable {
private Thread innerThread;
private int stageIndex;

public Loading(int stageIndex) {
this.stageIndex = stageIndex;
innerThread = new Thread(this);
innerThread.start();
}

public void run() {
isLoading = true;
loadPercent = 0;
System.gc();
loadStage(stageIndex);
isLoading = false;
}
}

public void sleep() {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

這個是游戲主體類

下面是游戲的人物類

package Game;

import javax.microedition.lci.Image;
import javax.microedition.lci.game.Sprite;

public abstract class Role extends Sprite {

/**
* 人物的基本屬性
*/
protected int type;
protected int xCoodinate;
protected int yCoodinate;
protected int row;
protected int col;
protected int width;
protected int height;
protected int speed;
protected int status;
protected boolean isCanOperate = false;
protected boolean isAlive = true;

/**
* 人物放置炸彈的基本屬性
*/
protected int power;
protected int bombNums;

protected int characterClock = 0;
protected int deadTime = 0;

protected Game game;

protected Role(Image image, int width, int Height, Game game) {
super(image, width, Height);
this.game = game;
}

/**
* 人物拾起道具
* @param tool
*/
public abstract void pickupTool(int tool);
/**
* 碰撞檢測以及坐標的改變,如果對行走條件有特殊需求,既可以在這里寫自己的條件
* @param direction
*/
public abstract void collisionCheck(int direction);

public void updateRole() {
if (this.characterClock < 10000) {
this.characterClock++;
} else {
this.characterClock = 100;
}

int row = this.getRow();
int col = this.getCol();

if (this.isAlive) {

int tool = this.game.map.getToolLayer().getCell(col, row);

if (tool > 0) {
this.pickupTool(tool);
this.game.map.getToolLayer().setCell(col, row, 0);
}

if (this.game.map.hasFeature(row, col, Global.DEADLY)) {
this.isAlive = false;
return;
}

if (this.status == Global.BORN
&& this.characterClock > Global.BORN_TIME) {
this.status = Global.SOUTH;
this.setFrame(Global.SOUTH * 6);
this.isCanOperate = true;
}

if (this.status == Global.BORN) {
if (this.characterClock % 2 == 0)
this.setFrame(Global.BORN * 6 + (this.getFrame() - 1) % 4);
return;
}

} else {
this.isCanOperate = false;
if (this.deadTime <= 20) {
this.deadTime++;
} else {
this.deadTime = 100;
this.setVisible(false);
return;
}

if (this.characterClock % 2 == 0) {
if (this.getFrame() < Global.DEAD * 6) {
this.setFrame(Global.DEAD * 6);
} else {
if (this.getFrame() < 29) {
this.setFrame(this.getFrame() + 1);
} else {
if (this.characterClock % 4 == 0) {
this.setFrame(29);
this.setVisible(true);
} else {
this.setVisible(false);
}
}
}
}
}
}

public void walk(int direction) {
if (!isAlive)
return;
if (!isCanOperate)
return;
if(direction==9) return;
this.collisionCheck(direction);

if (this.characterClock % 2 == 0) {
if (this.status == direction) {
this.setFrame(this.status * 6 + (this.getFrame() + 1) % 6);
} else {
this.status = direction;
this.setFrame(this.status * 6);
}
}
this.setPosition(xCoodinate, yCoodinate);
}

public void stop() {
this.isCanOperate = false;
}

public void play() {
this.isCanOperate = true;
}

public abstract void setBomb(int row, int col);

public void increaseBomb() {
if (this.bombNums < Global.MAX_BOMB_NUMBER)
this.bombNums++;
}

public int getRow() {
return getRow(getBottomY(yCoodinate) - Global.MAP_CELL / 2);
}

public int getCol() {
return getCol(xCoodinate + Global.MAP_CELL / 2);
}

protected int getBottomY(int y) {
return y + this.height - 1;
}

protected int getRightX(int x) {
return x + Global.MAP_CELL - 1;
}

protected int getPreY(int y) {
return getBottomY(y) + 1 - Global.MAP_CELL;
}

protected int getRow(int x) {
return x / Global.MAP_CELL;
}

protected int getCol(int y) {
return y / Global.MAP_CELL;
}
}

我的QQ是609419340

看不明白的可以隨時來問我哦,還可以當時傳給你撒

⑥ C++做一個小游戲,有源代碼的最好,謝謝

#include <iostream>
#include<fstream>
#include <ctime>
#include <cmath>
#include <stdlib.h>
#include<stdio.h> //時間 //文件
#include <string>
#define random(x)(rand()%x)
using namespace std;
void thunder(int Dif,int Row,int Column,char *USer)
{
int r,c,alls[22][22],backstage[22][22]={0};
srand((int)time(0));
for(r=1;r<=Row;r++) // 生成alls(0~1)1是雷
{
for(c=1;c<=Column;c++)
{
if(random(6)<1) {alls[r][c]=1;} else{alls[r][c]=0;};
}
};
for(r=0;r<=Row+1;r++) //生成 backstage(正確答案)
{
for(int c=0;c<=Column+1;c++)
{
if(alls[r][c]==1)
{
(int)backstage[r][c]='*'; //將1變為 * 代表雷
}
else
{
for(int i=r-1;i<=r+1;i++) //將0變為數字 (代表周圍雷數)
for(int j=c-1;j<=c+1;j++)
{

if(alls[i][j]!=alls[r][c]&&alls[i][j]==1){backstage[r][c]++;};
}
}; //else 結束
}; // for 結束
}; // for 結束
cout<<"======================*********================================"<<endl;
char surface[22][22]; //生成surface(用戶界面)
for(r=0;r<22;r++) //全部為零
for(c=0;c<22;c++)
{
surface[r][c]='0';
}
for(r=1;r<=Row;r++) //中間化 # 形成0包圍#的形式 (通過數 #-->(*||數字) 的個數 贏的時候停止循環)
for(c=1;c<=Column;c++)
{
surface[r][c]='#';
}
for(r=1;r<=Row;r++) //輸出 surface 界面 便於檢查
{
for(c=1;c<=Column;c++) {cout<<" "<<surface[r][c];};
cout<<endl;
};
cout<<"請按格式輸入"<<endl
<<"前兩個數字為坐標,最後一個數字「1」表示此位置為雷,「0」則表示不是。"<<endl
<<"如:1 3 1 表示一行三列是雷;2 4 0 表示二行四列不是雷"<<endl
<<"提示:當數字周圍雷都被掃出時,可再次按要求輸入此位置,可得到周圍數字。"<<endl;
long i=10000000L; //計算時間開始
clock_t start,finish;
double ration;
start=clock();
while(i--); //計算時間開始
int num=Row*Column; //計算#號個數
while(num!=0) //控制 是否點完所有位置
{
int x,y,judge;
cin>>x>>y>>judge;
if(alls[x][y]!=judge)
{
cout<<"you lose!!!"<<endl;
cout<<"The answer is:"<<endl;
for(r=1;r<=Row;r++) //輸了 輸出backstage 顯示正確答案
{
for(int c=1;c<=Column;c++)
{
cout<<" "<<(char)(backstage[r][c]==42?backstage[r][c]:backstage[r][c]+'0'); //輸出backstage
}
cout<<endl;
}
break;
}
else
{
if(alls[x][y]==1) {if(surface[x][y]=='#'){num--;}surface[x][y]='@'; } // 雷 判斷正確 顯示「@」;數「#」
else
{
if(backstage[x][y]!=0) // 數字 判斷正確 顯示數字
{
if(surface[x][y]=='#'){num--; surface[x][y]=backstage[x][y]+'0'; } // 數「#」
else
{
int lei_num=0;
for(int i=x-1;i<=x+1;i++) //數 數字周圍 雷的個數
for(int j=y-1;j<=y+1;j++)
{
if(surface[i][j]=='@')
lei_num++;
}
if(backstage[x][y]==lei_num) // 看數字周圍雷是否全部掃出 提示 顯示數字周圍
{
for(int i=x-1;i<=x+1;i++)
for(int j=y-1;j<=y+1;j++)
if(surface[i][j]=='#') //數「#」
{
surface[i][j]=backstage[i][j]+'0';
num--;
}
}
}
}
else // 數字為零時 顯示零周圍的零
{
if(surface[x][y]=='#'){num--;}; //數「#」
surface[x][y]=backstage[x][y]+'0';
for(int i=x-1;i<=x+1;i++) // 顯示零周圍的數字
for(int j=y-1;j<=y+1;j++)
if(surface[i][j]=='#') // 避免 死循環
{
surface[i][j]=backstage[i][j]+'0';
num--; //數「#」
}
for(int k=0;k<20;k++) //最多20層零 (點出最邊上的零)
{
for (int R=1;R<=Row;R++) //檢查所有零
for(int C=1;C<=Column;C++) //再次顯示零周圍的數字
{
if(surface[R][C]=='0')
{
for(int i=R-1;i<=R+1;i++)
for(int j=C-1;j<=C+1;j++)
{
if(surface[i][j]=='#') // 避免 死循環 數「#」
{
surface[i][j]=backstage[i][j]+'0';
num--;
}
}
}
} //匹配for 內
} //匹配 for 外
}//匹配else
}//匹配else
}//匹配els
cout<<endl;
cout<<"======================*********================================"<<endl;
for(r=1;r<=Row;r++) //輸出界面(已修改)
{
for(c=1;c<=Column;c++) {cout<<" "<<surface[r][c];};
cout<<endl;
};
} //匹配while
finish=clock(); //計算時間結束
ration=(double)(finish-start)/CLOCKS_PER_SEC; //時間變數
if(num==0) //所有
{
cout<<" You win! Congratulations!! "<<endl;
cout<<" Your time is: "<<ration<<endl;
if(Dif==1) //讀取 簡單掃雷 的存儲文件
{
string Name;
string name[6];
double Time,rang;
double times[6];
int i=0;
ifstream inf("掃雷 簡單.txt");
for(i=0;i<5;i++) //文件中信息導入到數組里
{
inf>>Name;inf>>rang>>Time;
name[i]=Name;
times[i]=Time;
}
inf.close();
name[5]=USer; //本輪玩家信息
times[5]=ration;
double t1=0;
string t2;
for(int j=0;j<5;j++) //冒泡排序法
{
for(i=0;i<5-j;i++)
{
if(times[i]>times[i+1])
{
t1=times[i];
times[i]=times[i+1];
times[i+1]=t1;
t2=name[i];
name[i]=name[i+1];
name[i+1]=t2;
}
}
}
ofstream outf("掃雷 簡單.txt");
for(i=0;i<5;i++) //將前五名玩家信息存儲到文件中
{
cout<<name[i]<<" "<<i+1<<" "<<times[i]<<endl;
outf<<name[i]<<" "<<i+1<<" "<<times[i]<<endl;
}
outf.close();
}
if(Dif==2) //讀取 一般掃雷 的存儲文件
{
string Name;
string name[6];
double Time,rang;
double times[6];
int i=0;
ifstream inf("掃雷 一般.txt");
for(i=0;i<5;i++) //文件中信息導入到數組里
{
inf>>Name;inf>>rang>>Time;
name[i]=Name;
times[i]=Time;
}
inf.close();
name[5]=USer; //本輪玩家信息
times[5]=ration;
double t1=0;
string t2;
for(int j=0;j<5;j++) //冒泡排序法
{
for(i=0;i<5-j;i++)
{
if(times[i]>times[i+1])
{
t1=times[i];
times[i]=times[i+1];
times[i+1]=t1;
t2=name[i];
name[i]=name[i+1];
name[i+1]=t2;
}
}
}
ofstream outf("掃雷 一般.txt");
for(i=0;i<5;i++) //將前五名玩家信息存儲到文件中 並輸出
{
cout<<name[i]<<" "<<i+1<<" "<<times[i]<<endl;
outf<<name[i]<<" "<<i+1<<" "<<times[i]<<endl;
}
outf.close();
}
if(Dif==3) //讀取 困難掃雷 的存儲文件
{
string Name;
string name[6];
double Time,rang;
double times[6];
int i=0;
ifstream inf("掃雷 困難.txt");
for(i=0;i<5;i++) //文件中信息導入到數組里
{
inf>>Name;inf>>rang>>Time;
name[i]=Name;
times[i]=Time;
}
inf.close();
name[5]=USer; //本輪玩家信息
times[5]=ration;
double t1=0;
string t2;
for(int j=0;j<5;j++) //冒泡排序法
{
for(i=0;i<5-j;i++)
{
if(times[i]>times[i+1])
{
t1=times[i];
times[i]=times[i+1];
times[i+1]=t1;
t2=name[i];
name[i]=name[i+1];
name[i+1]=t2;
}
}
}
ofstream outf("掃雷 困難.txt");
for(i=0;i<5;i++) //將前五名玩家信息存儲到文件中
{
cout<<name[i]<<" "<<i+1<<" "<<times[i]<<endl;
outf<<name[i]<<" "<<i+1<<" "<<times[i]<<endl;
}
outf.close();
}
}
}
void scale(int dif,char *User) //選擇難度
{
int row,column;
if(dif==1) {row=3;column=3;}
if(dif==2) {row=7;column=7;}
if(dif==3) {row=10;column=10;}
cout<<"The scale is: "<<row<<"*"<<column<<endl;
thunder(dif,row,column,User);
};
int main()
{
int Continue=1;
int difficulty;
char user[10];
cout<<" Welcom to the game! "<<endl
<<" 請輸入用戶名! "<<endl;
cin>>user;
while(Continue==1)
{
cout<<"=======================*******************======================="<<endl
<<" 請選擇難度! "<<endl
<<" 簡單——1 "<<endl
<<" 一般——2 "<<endl
<<" 困難——3 "<<endl;
cin>>difficulty;
scale(difficulty,user);
cout<<"繼續游戲——1 結束游戲——0"<<endl;
cin>>Continue;
}
return 0;
}
掃雷小游戲,自己編的代碼

⑦ 請問網路游戲的源代碼是什麼

網路游戲源代碼就是游戲的基礎,在外行人眼裡是無數行的英文和數字,其實就是一組程序。

作用當然是開發游戲啦。
手上擁有了源代碼就可以製作游戲,當然如果你啥都不改,那功能就和原來的游戲沒什麼兩樣。
現在網上你可以搜索一下網路游戲的源代碼還是非常多的,但是大多數都是不完整的,也就是說你即便得到了也無法用。
另外只要這款游戲是國產的,你如果一模一樣也不行,因為違反版權。
所以就算你拿到了源代碼,你也要有完整的美術資源,需要讓程序貼圖替換上去,達到視覺上不一樣的效果。世界背景和故事都要換,所有這些的成本當然不是一般的高。
好吧,即便你搞好了,那接下來你還要運營吧,運營的成本就更高了。

閱讀全文

與爆點娛樂游戲源碼相關的資料

熱點內容
單片機實驗報告電子琴 瀏覽:742
程序員恢復微信文件代碼 瀏覽:517
有漁python 瀏覽:79
pdf字體加深 瀏覽:204
怎麼做一個minecraft伺服器 瀏覽:769
c語言實現ls命令 瀏覽:663
小洋糕解壓視頻 瀏覽:450
域名內網訪問內網伺服器地址 瀏覽:138
我的世界伺服器如何摳掉金幣 瀏覽:223
域名與ip地址通過什麼伺服器查 瀏覽:95
企業網站需要什麼雲伺服器配置 瀏覽:910
遼事通伺服器出現錯誤是什麼原因 瀏覽:765
能否將一個表格的子表加密 瀏覽:63
手機ios微信收藏怎麼加密 瀏覽:593
安卓如何改黑色 瀏覽:330
oracle資料庫導出命令 瀏覽:696
用python做鍾表盤 瀏覽:874
腰椎壓縮性骨折吧 瀏覽:326
安卓怎麼把軟體改成火影忍者 瀏覽:704
手機如何切換軟體商店伺服器 瀏覽:326