From ef3c5c672690a7edf938e1415f16e5ef81c2f6b7 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 11 Sep 2017 06:54:07 +0000 Subject: [PATCH] The Bus game, not playable yet git-svn-id: svn://kolibrios.org@6970 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/the_bus/Tupfile.lua | 6 + programs/cmm/the_bus/compile.bat | 5 + programs/cmm/the_bus/draw_scalled.h | 29 +++ programs/cmm/the_bus/menu.png | Bin 0 -> 6878 bytes programs/cmm/the_bus/road.png | Bin 0 -> 14993 bytes programs/cmm/the_bus/the_bus.c | 293 ++++++++++++++++++++++++++++ 6 files changed, 333 insertions(+) create mode 100644 programs/cmm/the_bus/Tupfile.lua create mode 100644 programs/cmm/the_bus/compile.bat create mode 100644 programs/cmm/the_bus/draw_scalled.h create mode 100644 programs/cmm/the_bus/menu.png create mode 100644 programs/cmm/the_bus/road.png create mode 100644 programs/cmm/the_bus/the_bus.c diff --git a/programs/cmm/the_bus/Tupfile.lua b/programs/cmm/the_bus/Tupfile.lua new file mode 100644 index 0000000000..cd9d6f889d --- /dev/null +++ b/programs/cmm/the_bus/Tupfile.lua @@ -0,0 +1,6 @@ +if tup.getconfig("NO_CMM") ~= "" then return end +if tup.getconfig("LANG") == "ru" +then C_LANG = "LANG_RUS" +else C_LANG = "LANG_ENG" -- this includes default case without config +end +tup.rule("the_bus.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "the_bus.com") diff --git a/programs/cmm/the_bus/compile.bat b/programs/cmm/the_bus/compile.bat new file mode 100644 index 0000000000..4d6f907200 --- /dev/null +++ b/programs/cmm/the_bus/compile.bat @@ -0,0 +1,5 @@ +@del the_bus +@c-- the_bus.c +@rename the_bus.com the_bus +@del warning.txt +@pause \ No newline at end of file diff --git a/programs/cmm/the_bus/draw_scalled.h b/programs/cmm/the_bus/draw_scalled.h new file mode 100644 index 0000000000..11ef8be217 --- /dev/null +++ b/programs/cmm/the_bus/draw_scalled.h @@ -0,0 +1,29 @@ +void DrawScaledBar(dword x,y,w,h,col) { + DrawBar( + x*SCALE, + y*SCALE, + w*SCALE, + h*SCALE, + col + ); +} +void DrawScaledImage(dword image_pointer,x,y,w,h,offx,offy) { + img_draw stdcall ( + image_pointer, + x*SCALE, + y*SCALE, + w*SCALE, + h*SCALE, + offx*SCALE, + offy*SCALE + ); +} +void WriteScaledText(dword x,y,font,color,text) { + WriteText( + x*SCALE, + y*SCALE, + font + SCALE, + color, + text + ); +} \ No newline at end of file diff --git a/programs/cmm/the_bus/menu.png b/programs/cmm/the_bus/menu.png new file mode 100644 index 0000000000000000000000000000000000000000..5c32e792fdcab255ba611cfe6984c3f3e8d41a1d GIT binary patch literal 6878 zcmc(Ei8s{$_y5dz;bm;EkzMgJls&4qrEIUk$WjQECCCijO z!bp@PQB=fOvTq?vwx93kpZJ~gIOjee_nvdlJ@=k_?!D(3ZDnzs7cY*-U@*LoE=jUFVN1^X@_nb< zb*I59_V%rvWG(-5meHOUvL7U5mR(RxX`h;!A{PzY+)mk9B#Xt>vikdWo*S)ND(!qQ zy=HCNZK%9cW_s7{&d%0Owq9B!YEH|ljO%Ym!r`E}^_=*RWRD7~0Uy^S4H3`T6y)QDso z_;dDG^zA3dsyHaE*ZVVEk{VwY6u9>8-`34t4e^f@!zM!T*u3Xz_kULd7=drfWqowS zr9l+_|AP07rK{tg;+Cd)-yW*#@9(zc;EOoJHjqyXW$y72quhwF!0>P+R<%=NA}(;y zDIkX}0Z0}2mo9Re2P?SzlM3VHC+5$?UKsp8adm#&jYx}!$s***2eiE)ol;Kh=H^hn zMW|yUI=@1UG}SdxZ_$Y~oVq@$DLU~8ohO19lhMJ7QCm~SHcO8$H z6sd+Jod%DUu$~v5euO(fYas|a)779Gw_+Ev&s@N_j0nq!X37eobV2zGK-QU9O8+%r z(q7ME69qf2cebx>@b%wx@Ll{i z`A|`S&6&9}@x>3Di`^M1wSrO7R{!p?OmC(C2&d@&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y5eu#nvB#XNEETUW7D}g413`{j-Q(y@@JzxTSwd#*A%rSMCU#y zMz$UV_P`01HjOj*u_7B!qqIQ%^vqks+uWq;heXqr1RHIwSrOva*%FS43Zm;%X z>w^Y|eY)z`28-3SblhKIa0(e&&Z0>N^USzHk>rfV*r-Qq7LmOfXYf}d;%)6s$ljxhW4_Df zq?kPVEK)cDEKyXwqP>bV)|2xO2=YE%CJmmmO(ky%=ZwBF=2+Dr%G^ADN}}T^1i!8C z6UE}5^?^Q5sTh!oDPwjLHn+HOY{t}XeJ?<3E7X{p7qSNw<__xLsT`geS=Nkfv@{g< zS?mj=JMx71F80Mx8StaGgSk69%^&9RsAv?KKo~M@m0!hTPa7$VzIT>Js8mTd87=^X kV1zn}`Jcc{25(F0Cx5ypviEuI?w=IKlx$&CVn9LvAAK(@T>t<8 literal 0 HcmV?d00001 diff --git a/programs/cmm/the_bus/road.png b/programs/cmm/the_bus/road.png new file mode 100644 index 0000000000000000000000000000000000000000..b524e46956380b0282bac3247bbe1853ccc0abc1 GIT binary patch literal 14993 zcmZv@cRZE<|37|?!?BJP@89kBN9($-=XE`vkH_Oa9@nKHbyYZE3j!5JQ0^O(0RIL%-&MQ;df&ma0Q@~sU0LfUa8NH?OwIS23jT_A zkf1@7#H+My+kiyfP?5X-NIP3gCGSf{(NZQa(YHOh&Ew_dT{%O;U+OtOyQ!cU5fvK} z784j8MIdw?9)cpD#|MQ*TPNSb%YrS;F*0arPW_7_!opQxkisn$q###FP%r}nBNrE^ z#$8R27|6sU3c-10b-001!Tz3?=)}TLew9aL*HjM<4zQwNln3h0s~ZPDOei44&1klC z3z{h$Xqo`t{Y>@qJ?T^`Xl06KqY3^>9>jg+>fR4!c2+iii`Vf9FV~Z3B;0FnXyW`$ zWGrJEU%H*&ofgG;dxSkWs}WSKW$b)TJ6b7n#L?w(Q)3+g0}?ZS=AKgLnmuZG3qFMb znI?}v(7!Jzaf|yZ$D6mW-zLYq2Lw+KH|p_GBiw%+Ci>kmj4Az?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 y`P1IQ9YLwG`RR(-U7)11{=kZp_XUTfYJWUMz-9P#;QuFrZr@aue}4nx^Zx)Y1vF^@ literal 0 HcmV?d00001 diff --git a/programs/cmm/the_bus/the_bus.c b/programs/cmm/the_bus/the_bus.c new file mode 100644 index 0000000000..3860926c2e --- /dev/null +++ b/programs/cmm/the_bus/the_bus.c @@ -0,0 +1,293 @@ +/* +THE BUS +Copyright (C) 2008, 2012, 2017 Leency +Menu image from Freepik.com +D O N K E Y +Copyright (C) 2008 O.Bogomaz +*/ + +#define MEMSIZE 1024 * 60; + +#include "..\lib\kolibri.h" +#include "..\lib\random.h" + +#include "..\lib\obj\libio_lib.h" +#include "..\lib\obj\libimg_lib.h" +#include "..\lib\patterns\libimg_load_skin.h" + +#define SCALE 2 + +#include "draw_scalled.h" + +libimg_image menu; +libimg_image road; + +int lives=0, level=0, score=0; +int don_x, don_y, don_h=40, don_type; +int bus_x, bus_y=147; + +#define SCR_MENU_MAIN 1 +#define SCR_GAME 2 +#define SCR_PAUSE 3 + + +#define WIN_X 258 * SCALE +#define WIN_Y 191 * SCALE + +int screen_type=SCR_MENU_MAIN; + +#define COLOR_ROAD 0x6D879B; + +int active_menu_item=0; + +char *ITEMS_LIST[]={ +"New game", +"Control keys", +"About", +"Exit", +0}; + + +//actually it has to be named DrawObstacle(), but I like Donkey more :) +void DrawDonkey(signed int x, y) { + int don_offset_x; + int don_offset_y; + int image_h; + + if (don_type<4) { + don_offset_y=0; + don_offset_x=don_type*40; + } + else { + don_offset_y = don_h + 1; + don_offset_x=don_type-3*40; + } + + image_h = don_h; + if (y < 0) { + image_h = don_h + y+1; + don_offset_y = don_h + y; + y = 0; + } + + DrawScaledImage(road.image, x, y, 39, image_h, don_offset_x, don_offset_y); +} +void DrawBus(dword x, y) { DrawScaledImage(road.image, x, y, 21, 45, 237, 0); } +void DrawBoom(dword x, y) { DrawScaledImage(road.image, x, y, 39, 34, 208, 47); } +void DrawHighway() { DrawScaledImage(road.image, 0,0, WIN_X, WIN_Y, 0, 82); } +void DrawMenuBackground() { DrawScaledImage(menu.image, 0, 0, WIN_X, WIN_Y, 0, 0); } + +void main() +{ + randomize(); + + load_dll(libio, #libio_init,1); + load_dll(libimg, #libimg_init,1); + Libimg_LoadImage(#menu, "/sys/fonts/home2x.png"); + Libimg_LoadImage(#road, "/sys/fonts/busimg2x.png"); + + loop() + { + WaitEventTimeout(1); + + switch(EAX & 0xFF) + { + case evKey: + GetKeys(); + if (key_scancode == SCAN_CODE_ESC) + { + if (screen_type==SCR_GAME) SetScreen(SCR_MENU_MAIN); + else if (screen_type==SCR_MENU_MAIN) ExitProcess(); + } + if (key_scancode == SCAN_CODE_DOWN) && (screen_type==SCR_MENU_MAIN) + { + if (active_menu_item<>3) active_menu_item++; ELSE active_menu_item=0; + DrawMenuList(); + } + if (key_scancode == SCAN_CODE_UP) && (screen_type==SCR_MENU_MAIN) + { + if (active_menu_item<>0) active_menu_item--; ELSE active_menu_item=3; + DrawMenuList(); + } + if (key_scancode == SCAN_CODE_ENTER) && (screen_type==SCR_MENU_MAIN) + { + if (active_menu_item==0) + { + lives=3; + level=0; + score=0; + SetScreen(SCR_GAME); + } + if (active_menu_item==1) notify("'The Bus\nControl keys:\nLeft, Right, Space\nPress P key for pause'tI"); + if (active_menu_item==2) notify("'The Bus\nVersion v0.2 Alpha\n\nAuthor: Leency\nMenu image from Freepik.com'tI"); + if (active_menu_item==3) ExitProcess(); + } + if (key_scancode == SCAN_CODE_SPACE) && (screen_type==SCR_GAME) + { + DrawScaledBar(bus_x*40+100,147, 21,45, COLOR_ROAD); + if (bus_x==1) bus_x=0; else bus_x=1; + } + if (key_scancode == SCAN_CODE_LEFT) && (screen_type==SCR_GAME) + { + if (bus_x==0) break; + DrawScaledBar(bus_x*40+100,147, 21,45, COLOR_ROAD); + bus_x=0; + } + if (key_scancode == SCAN_CODE_RIGHT) && (screen_type==SCR_GAME) + { + if (bus_x==1) break; + DrawScaledBar(bus_x*40+100,147, 21,45, COLOR_ROAD); + bus_x=1; + } + if (key_scancode == SCAN_CODE_KEY_P) + { + if (screen_type==SCR_MENU_MAIN) break; + else if (screen_type==SCR_GAME) SetScreen(SCR_PAUSE); + else if (screen_type==SCR_PAUSE) SetScreen(SCR_GAME); + } + break; + + case evReDraw: + DefineAndDrawWindow(250,150,WIN_X-1+10,WIN_Y-1+skin_height+7,0x74,0,"The Bus",0); + DrawScreen(); + break; + + case evButton: + ExitProcess(); + break; + + default: + if (screen_type==SCR_GAME) DrawRoad(); + break; + } + } +} + +void WriteScore() { + DrawScaledImage(road.image, 10, 83, 60, 12, 10, 83+82); + WriteScaledText(10, 70, 0x80, 0xFFFFFF, "Score"); + WriteScaledText(10, 83, 0x80, 0xFFFFFF, itoa(score)); +} + +void SetScreen(dword _screen_type) { + screen_type = _screen_type; + DrawScreen(); +} + +void DrawScreen() +{ + if (screen_type==SCR_MENU_MAIN) + { + DrawMenuBackground(); + WriteScaledText(10, 10, 0x80, 0xE8783F, "TAKE THE CHILDREN HOME"); + $add ebx, 2 << 16 + $int 64 + DrawMenuList(); + } + if (screen_type==SCR_GAME) || (screen_type==SCR_PAUSE) + { + DrawHighway(); + WriteScaledText(10, 10, 0x80, 0xFFFFFF, "Lives"); + WriteScaledText(10, 23, 0x80, 0xFFFFFF, itoa(lives)); + WriteScaledText(10, 40, 0x80, 0xFFFFFF, "Level"); + WriteScaledText(10, 53, 0x80, 0xFFFFFF, itoa(level)); + WriteScore(); + DrawRoad(); + if (screen_type==SCR_PAUSE) { + DrawScaledBar(0,0,70,30,0xFF0000); + WriteScaledText(5,7,0x81,0xFFFfff,"PAUSE"); + } + } +} + + +void DrawMenuList() +{ + int j; + for (j=0; j<4; j++) DrawMenuItem(j, j); +} + +void DrawMenuItem(int item_n, text_n) +{ + dword color; + if (active_menu_item==item_n) color = 0xFF0000; else color = 0xFFffff; + WriteScaledText(10+1, item_n*28+48+1, 0x80, 0xAAAaaa, ITEMS_LIST[text_n]); + WriteScaledText(10, item_n*28+48, 0x80, color, ITEMS_LIST[text_n]); +} + + +void DrawGameOverMessage() +{ + DrawScaledBar(0, 0, WIN_X, WIN_Y, 0xF3E1BD); + WriteScaledText(20, 20, 0x80, 0xA48C74, "GAME OVER"); + WriteScaledText(20, 40, 0x80, 0xA48C74, "FINAL SCORE"); + WriteScaledText(20, 70, 0x84, 0xA48C74, itoa(score)); + $add ecx, 2 << 16 + $int 64 + pause(350); + active_menu_item=0; + SetScreen(SCR_MENU_MAIN); + return; +} + +void DrawAccident() +{ + DrawBus(bus_x*40+100,bus_y); + DrawBoom(bus_x*40+90,152); + pause(150); + lives--; + don_y = -don_h; + DrawScreen(); + if (lives>0) DrawScaledBar(bus_x*40+90, 147-17, 39, 45+23, COLOR_ROAD); +} + +#define LINE_LENGTH 10 +void DrawRoad() +{ + byte y,line_y; + + if ((don_x == bus_x)&&(don_y + don_h > bus_y )&&(don_y + don_h < bus_y )) DrawAccident(); + + if (lives==0) { + DrawGameOverMessage(); + return; + } + + if (screen_type != SCR_PAUSE) + { + line_y+=2; + don_y+=2; + } + + //the beginning of the white dashed line between two roadways + if (line_y>=20) { + line_y=0; + } + else + { + DrawScaledBar(129, 0, 1, line_y, COLOR_ROAD); + DrawScaledBar(129, 0, 1, line_y-LINE_LENGTH, 0xDDE9F2); + } + for (y=0; y<190; y+=20) //white dashed line between two roadways + { + DrawScaledBar(129, line_y+y, 1, LINE_LENGTH, 0xDDE9F2); + DrawScaledBar(129, line_y+y+LINE_LENGTH, 1, LINE_LENGTH, COLOR_ROAD); + } + if (don_y>=210) + { + don_x = random(2); + don_y = -don_h; + don_type = random(7); + score++; + WriteScore(); + } + DrawScaledBar(don_x*don_h+93, don_y-2, 30, 2, COLOR_ROAD); //Fill donkey old parts + DrawDonkey(don_x*don_h+90,don_y); + DrawBus(bus_x*don_h+100,147); +} + + + + + +stop: