我自己用的melonjs,感觉还不错,上手难度也不高,里面除了可以自己撸地图场景还可以用tiled界面画地图。
struct maptype{
int money,belong
char name[20]
}map[9][13]={0}
struct player
{
int x,y,money,di
}man[3]={0}
int dx[5]={0,0,1, 0,-1}
int dy[5]={0,1,0,-1, 0}
int i,j,x,y
int turn,step,res
char out[1000]
char *s11="姓名史艳文"
char *s12="资金"
char *s21="姓名比卡超"
char *s22="资金"
char *s31="你需要付给对手"
char *s32="元"
char *s41="老友轮到你走啦"
char *s42="轮到对手走啦"
char *s51="买下此地要"
char *s52="买"
char *s53="不买"
char *s54="老大你的钱不够"
char *z1="起点"
char *z2="休息处"
char *fa="经过起点发旅费"
char *m1="路过岳王庙"
char *m2="路过纯白镇"
char *m3="获取钱三千"
char *m4="获取钱六千"
char *zi1="行"
char *zi2="动"
char *zi3="查"
char *zi4="看"
char *zi5="离"
char *zi6="开"
char *last="你要花两千元升级地价吗"
#define ESC 0x011b
#define ENTER 0x1c0d
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define UP0x4800
#define DOWN 0x5000
#include<stdio.h>
#include<stdlib.h>
#include"first.c"
#include<graphics.h>
#include "bmp16.h"
#include"files.c"
int graphdriver=VGA
int graphmode=VGAHI
FILE *hzk_p
void open_hzk(void)
void get_hz(char incode[],char bytes[])
void dishz(int x,int y,char code[],int color)
#include"rich2.c"
int main()
{
initgraph(&graphdriver,&graphmode,"")
cleardevice()
open_hzk()
first()
begin()
files()
setbkcolor(0)
while (1)
{
print(0)
step=random(6)+1
{}
if (turn==1)
{
next3()
}
chuli(turn,step)
buy()
{}
turn=(turn+1)%2
if (turn==0)
turn=2
step=0
}
return 0
}
void open_hzk()
{
hzk_p=fopen("hzk16","rb")
if (!hzk_p)
{
printf("The file no\n")
getch()
closegraph()
exit(1)
}
}
void get_hz(char incode[],char bytes[])
{
unsigned char qh,wh
unsigned long offset
qh=incode[0]-0xa0
wh=incode[1]-0xa0
offset=(94*(qh-1)+(wh-1))*32L
fseek(hzk_p,offset,SEEK_SET)
fread(bytes,32,1,hzk_p)
}
void dishz(int x0,int y0,char code[],int color)
{
unsigned char mask[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}
int i,j,x,y,pos
char mat[32]
get_hz(code,mat)
y=y0
for(i=0i<16i++)
{
x=x0
pos=2*i
for (j=0j<16j++)
{
if ((mask[j%8]&mat[pos+j/8])!=NULL)
putpixel(x,y,color)
++x
}
++y
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)