基于MSP430的LCD1284赛车小游戏开发(2)

2019-08-31 14:36

for(temp=speed;temp>0;temp--) {

update_fraps_some(1,16); update_fraps_some(95,110);

update_to_LCD(car2_x,car2_y,block,2,12); car2_x++;

show_car2(car2_x,car2_y); } }

if(speed == 2) {

update_speed(speed); for(temp=speed;temp>0;temp--) {

update_fraps_some(1,16); update_fraps_some(95,110);

update_to_LCD(car2_x,car2_y,block,2,12); car2_x++;

show_car2(car2_x,car2_y); }

}

if(speed == 3) {

update_speed(speed); for(temp=speed;temp>0;temp--) {

update_fraps_some(1,16); update_fraps_some(95,110);

update_to_LCD(car2_x,car2_y,block,2,12); car2_x++;

show_car2(car2_x,car2_y); } }

if(speed == 4) {

update_speed(speed); for(temp=speed;temp>0;temp--) {

update_fraps_some(1,16); update_fraps_some(95,110);

update_to_LCD(car2_x,car2_y,block,2,12); car2_x++;

show_car2(car2_x,car2_y); } }

if(direction == 1) //控制车的方向向左,把车的位置向左移动1 {

update_to_LCD(x,y,block,2,12); //先把原位置的图案清空 y=y-2;

if(y<=16) y=17; }

if(direction == 2) //控制车的方向向右,把车的位置向右移动1 {

update_to_LCD(x,y,block,2,12); //先把原位置的图案清空 y=y+2;

if(y>=84) y=83; }

update_to_LCD(x,y,car,2,12);//把当前车的位置更新上去

judge_score(); //判断与更新得分 LCD_Draw_Pic(LCD); delay_ms(50); }

return 0; }

六、结果展示

1.开始游戏

2.游戏画面

七、附件(程序)

(全部程序)

Main.c

#include #include \ #include \ #include \ #include \ #include \

unsigned char x=49,y=50,car2_x=1,car2_y=40; unsigned int score = 0;


基于MSP430的LCD1284赛车小游戏开发(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:(给力下载)2012江苏省专业技术人员信息化素质模拟题(8)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: