#include "DxLib.h"
#include <stdio.h>
#include <math.h>
void loadg();
//String 使用
#include <string>
using namespace std;
//プログラム中
//main-10
//タイトル-100
int main=100,maintm=0;
//ステージ
int stagecolor=0;
int sta=1,stb=4,stc=0;
//クイック
int fast=1;
//トラップ表示
int trap=1;
//中間ゲート
int tyuukan=0;
//スタッフロール
int ending=0;
//ステージ読み込みループ(いじらない)
int stagerr,stagepoint;
//オーバーフローさせる
int over=0;
//ステージスイッチ
int stageonoff=0;
//メインプログラム
void Mainprogram();
void rpaint();
int maint;
//サブクラス
//(ウエイト系
void wait(int interval);
void wait2(long stime, long etime,int FLAME_TIME);
int rand(int Rand);
void end();
//描画
int color;
void setfont(int a);
void setcolor(int red, int green, int blue);
void setc0();
void setc1();
void drawpixel(int a,int b);
void drawline(int a,int b,int c,int d);
void drawrect(int a,int b,int c,int d);
void fillrect(int a,int b,int c,int d);
void drawarc(int a,int b,int c,int d);
void fillarc(int a,int b,int c,int d);
int grap[161][8],mgrap[51];
int loadimage(string b);
int loadimage(int a,int x,int y,int r,int z);
int mirror;
void drawimage(int mx,int a,int b);
void drawimage(int mx,int a,int b,int c,int d,int e,int f);
void setre();
void setre2();
void setno();
int oto[151];
void ot(int x);void bgmchange(int x);
//文字
void str(string c,int a,int b);
//)
void stagecls();
void stage();
void stagep();
//1-ステージ
//10-ステージ前
//
//ループ
int t,tt,t1,t2,t3,t4;
//初期化
int zxon,zzxon;
//キーコンフィグ
int key,keytm;
//三角関数
double pai=3.1415926535;
//地面
#define smax 31
int sx,sco;
int sa[smax],sb[smax],sc[smax],sd[smax],stype[smax],sxtype[smax],sr[smax];
int sgtype[smax];
//プレイヤー
int mainmsgtype;
int ma,mb,mnobia,mnobib,mhp;
int mc,md,macttype,atkon,atktm,mactsok,msstar,nokori=2,mactp,mact;
int mtype,mxtype,mtm,mzz;
int mzimen,mrzimen,mkasok,mmuki,mmukitm,mjumptm,mkeytm,mcleartm;
int mmutekitm,mmutekion;
int mztm,mztype;
int actaon[7];
//メッセージ
int mmsgtm,mmsgtype;
int mascrollmax=21000;//9000
//ブロック
void tyobi(int x,int y,int type);
void brockbreak(int t);
#define tmax 641
int tco;
int ta[tmax],tb[tmax],tc[tmax],td[tmax],thp[tmax],ttype[tmax];
int titem[tmax],txtype[tmax];
//メッセージブロック
int tmsgtm,tmsgtype,tmsgx,tmsgy,tmsgnobix,tmsgnobiy,tmsg;
void ttmsg();void txmsg(string x,int a);
void setfont(int x,int y);
//効果を持たないグラ
void eyobi(int xa,int xb,int xc,int xd,int xe,int xf,int xnobia,int xnobib,int xgtype,int xtm);
#define emax 201
int eco;
int ea[emax],eb[emax],enobia[emax],enobib[emax],ec[emax],ed[emax];
int ee[emax],ef[emax],etm[emax];
int egtype[emax];
//敵キャラ
void ayobi(int xa,int xb,int xc,int xd,int xnotm,int xtype,int xxtype);
void tekizimen();
#define amax 24
int aco;
int aa[amax],ab[amax],anobia[amax],anobib[amax],ac[amax],ad[amax];
int ae[amax],af[amax],abrocktm[amax];
int aacta[amax],aactb[amax],azimentype[amax],axzimen[amax];
int atype[amax],axtype[amax],amuki[amax],ahp[amax];
int anotm[amax],anx[160],any[160];
int atm[amax],a2tm[amax];
int amsgtm[amax],amsgtype[amax];
//敵出現
#define bmax 81
int bco;
int ba[bmax],bb[bmax],btm[bmax];
int btype[bmax],bxtype[bmax],bz[bmax];
//背景
#define nmax 41
int nxxmax,nco;
int na[nmax],nb[nmax],nc[nmax],nd[nmax],ntype[nmax];
int ne[nmax],nf[nmax],ng[nmax],nx[nmax];
//リフト
#define srmax 21
int srco;
int sra[srmax],srb[srmax],src[srmax],srd[srmax],sre[srmax],srf[srmax];
int srtype[srmax],srgtype[srmax],sracttype[srmax],srsp[srmax];
int srmuki[srmax],sron[srmax],sree[srmax];
int srsok[srmax],srmovep[srmax],srmove[srmax];
//スクロール範囲
int fx=0,fy=0,fzx,fzy,scrollx,scrolly;
//全体のポイント
int fma=0,fmb=0;
//強制スクロール
int kscroll=0;
//画面サイズ(ファミコンサイズ×2)(256-224)
int fxmax=48000,fymax=42000;
//ステージ
byte stagedate[17][2001];
//画面黒
int blacktm=1,blackx=0;
//自由な値
int xx[91];
double xd[11];
string xs[31];
//タイマー測定
long stime;
// プログラムは WinMain から始まります
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ){
//画面サイズ設定
SetGraphMode( fxmax/100 , fymax/100 , 16 ) ;
//
SetWindowIconID(127);
//最大化の防止
ChangeWindowMode(TRUE ) ;
//タイトルの変更
SetMainWindowText( "しょぼんのアクション" ) ;
//applog無効
SetOutApplicationLogValidFlag(false);
// DXライブラリ初期化処理(エラーが起きたら直ちに終了)
if( DxLib_Init() == -1 )return -1 ;
// 点を打つ
//DrawPixel( 320 , 240 , 0xffff ) ;
// キー入力待ち
//WaitKey();
//全ロード
loadg();
//フォント
SetFontSize(16) ;
SetFontThickness(4) ;
//ループ
//for (maint=0;maint<=2;maint++){
while( ProcessMessage() == 0 && CheckHitKey( KEY_INPUT_ESCAPE ) == 0){
maint=0;Mainprogram();
if (maint==3)break;
}
//DXライブラリ使用の終了処理
DxLib_End() ;
// ソフトの終了
return 0 ;
}
//メイン描画
void rpaint(){
//ダブルバッファリング
SetDrawScreen(DX_SCREEN_BACK);
ClearDrawScreen();
setcolor(0,0,0);
//if (stagecolor==1)setcolor(170,170,255);
if (stagecolor==1)setcolor(160,180,250);
if (stagecolor==2)setcolor(10,10,10);
if (stagecolor==3)setcolor(160,180,250);
if (stagecolor==4)setcolor(10,10,10);
fillrect(0,0,fxmax,fymax);
/*
//文字を書く
setcolor(0,0,120);
xs[1]="";
char num_str[255];
sprintf_s(num_str, sizeof(num_str),"%d",mjumptm);
xs[3]=xs[1]+num_str;
str(xs[3],10,10);
*/
if (main==1 && zxon>=1){
//背景
for (t=0;t<nmax;t++){
xx[0]=na[t]-fx;xx[1]=nb[t]-fy;
xx[2]=ne[ntype[t]]*100;xx[3]=nf[ntype[t]]*100;
xx[2]=16000;xx[3]=16000;
if (xx[0]+xx[2]>=-10 && xx[0]<=fxmax && xx[1]+xx[3]>=-10 && xx[3]<=fymax){
if (ntype[t]!=3)
drawimage(grap[ntype[t]][4],xx[0]/100,xx[1]/100);
if (ntype[t]==3)
drawimage(grap[ntype[t]][4],xx[0]/100-5,xx[1]/100);
//51
if (ntype[t]==100){
DrawFormatString(xx[0]/100+fma,xx[1]/100+fmb,GetColor(255,255,255),"51");
}
if (ntype[t]==101)
DrawFormatString(xx[0]/100+fma,xx[1]/100+fmb,GetColor(255,255,255),"ゲームクリアー");
if (ntype[t]==102)
DrawFormatString(xx[0]/100+fma,xx[1]/100+fmb,GetColor(255,255,255),"プレイしてくれてありがとー");
}}//t
//グラ
for (t=0;t<emax;t++){
xx[0]=ea[t]-fx;xx[1]=eb[t]-fy;
xx[2]=enobia[t]/100;xx[3]=enobib[t]/100;
if (xx[0]+xx[2]*100>=-10 && xx[1]<=fxmax && xx[1]+xx[3]*100>=-10-8000 && xx[3]<=fymax){
//コイン
if (egtype[t]==0)
drawimage(grap[0][2],xx[0]/100,xx[1]/100);
//ブロックの破片
if (egtype[t]==1){
if (stagecolor<=1 || stagecolor==3)setcolor(9*16,6*16,3*16);
if (stagecolor==2)setcolor(0,120,160);
if (stagecolor==4)setcolor(192,192,192);
fillarc(xx[0]/100,xx[1]/100,7,7);
setcolor(0,0,0);
drawarc(xx[0]/100,xx[1]/100,7,7);
}
//リフトの破片
if (egtype[t]==2 || egtype[t]==3){
if (egtype[t]==3)mirror=1;
drawimage(grap[0][5],xx[0]/100,xx[1]/100);
mirror=0;
}
//ポール
if (egtype[t]==4){
setc1();
fillrect((xx[0])/100+10,(xx[1])/100, 10, xx[3]);
setc0();
drawrect((xx[0])/100+10,(xx[1])/100, 10, xx[3]);
setcolor(250,250,0);
fillarc((xx[0])/100+15-1,(xx[1])/100,10,10);
setc0();
drawarc((xx[0])/100+15-1,(xx[1])/100,10,10);
}//4
//if (egtype[t]==1){
//drawimage(image[0],xx[0]/100+fma+5,xx[1]/100+fmb+5,0,0,10,10);
//おもしろ
//drawimage(image[2],xx[0]/100+fma,xx[1]/100+fmb,0,0,20,20);
//}
//if (egtype[t]==2)
//drawimage(image[11],xx[0]/
评论5
最新资源