全文预览

点阵赛车游戏

上传者:相惜 |  格式:doc  |  页数:28 |  大小:1015KB

文档介绍
0TO16):=(0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,7);--2号赛道红绿色车道的横坐标,后一个是绿色车道横坐标CONSTANTWY3:DIAN(0TO20):=(1,1,1,1,0,0,0,0,6,6,6,6,6,6,6,6,1,2,3,4,5);--3号赛道红绿色车道的横坐标,后五个是绿色车道横坐标CONSTANTWX3:DIAN(0TO20):=(0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,7,7,7,7,7);--0号赛道红绿色车道的横坐标,后五个是绿色车道横坐标SIGNALSTATE:INTEGERRANGE0TO1;TYPEFIGUREISARRAY(INTEGERRANGE<>)OFINTEGERRANGE0TO9;SIGNALSHOW:FIGURE(9DOWNTO0);--数码显示BEGINp1:PROCESS(CLOCK)--分频部分BEGINIFCLOCK'EVENTANDCLOCK='1'THENCOUNT<=COUNT+1;COUNT1<=COUNT1+1;COUNT_100hz<=COUNT_100hz+1;COUNT200<=COUNT200+1;COUNT2<=COUNT2+1;COUNT3<=COUNT3+1;IFCOUNT<=24999999THEN--1HZ分频CLK1hz<='1';ELSIFCOUNT>24999999ANDCOUNT<=49999999THENCLK1hz<='0';ELSIFCOUNT=50000000THENCOUNT<=0;ENDIF;IFCOUNT2<=9998THENCLK_1K<='1';ELSIFCOUNT2>9998ANDCOUNT2<=19997THENCLK_1K<='0';ELSIFCOUNT2=19998THENCOUNT2<=0;ENDIF;

收藏

分享

举报
下载此文档