廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 4536 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
hikaruggg
數位造型
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 路人甲 該用戶目前不上站
推文 x0 鮮花 x4
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[C/C++] 請問C++有辦法進行計時嗎
以下是我做的遊戲
請問有C++有計時的指令功能嗎
因為我想不到怎麼讓這個遊戲結束比較好
所以想用計時.
如果有大大的更好的想法 請指教...謝謝
p.s如果還有程式還有需要修正的請指導^^
謝謝...

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
#include<time.h>
//----------------------
#define up 72
#define down 80
#define left 75
#define right 77
#define esc 27
//----------------------
char m=15;
int x=40,y=49;
int object={0};
int missile={0};
int shoot;
int t;
int temp=48;
int ex=21,ey=2;
int score;
int bx,by;
int bombs=3;
float time_s,time_e;
float shoot_s,shoot_e;
float lag=0.0001,d=10;
//---------------------------------------------------------------------------
void side() //邊框描繪
{
int z;
clrscr();
gotoxy(20,1);
printf("%c",218);
gotoxy(60,1);
printf("%c",191);
gotoxy(20,50);
printf("%c",192);
gotoxy(60,50);
printf("%c",217);
for(z=21;z<=59;z++)
{
gotoxy(z,50);
printf("%c",196);
gotoxy(z,1);
printf("%c",196);
}
for(z=2;z<=49;z++)
{
gotoxy(20,z);
printf("%c",179);
gotoxy(60,z);
printf("%c",179);
}

}
//------------------------------------------------------------------------------
v ..

訪客只能看到部份內容,免費 加入會員 或由臉書 Google 可以看到全部內容




獻花 x0 回到頂端 [樓 主] From:台灣台灣固網 | Posted:2005-12-31 15:33 |
x_tiger
數位造型
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 路人甲 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

ANSI C標準中可以使用 time() 來取得時間

EX:

time_t ltime, ntime;

time(<ime);

while(1)
{
time(&ntime);
if((ntime - ltime) > 600)
break;
}


獻花 x0 回到頂端 [1 樓] From:台灣中華電信 | Posted:2006-01-03 11:05 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.021364 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言