timur77
Junior Member
Someday I will tell my grandsons that I am older than the Internet. And it will blow their brain.
Posts: 79
|
Post by timur77 on Mar 28, 2020 4:19:27 GMT -5
Improving the game "MAYHEM.bas" developed by Carl Gundel The first link to the file packed by Smart Instal Maker - unpacked, started, worked, closed, and deleted. Very comfortably Mortar.exeSecond link to source files Mortar.zip
|
|
|
Post by Rod on Mar 28, 2020 7:33:58 GMT -5
Welcome timur77. You will find that simply posting the .bas here is the best way to share. We all have the .dlls for Liberty and most folks are reluctant to run .exe files. The download sites are a pain as well trying to trick you into pressing other links.
If the program needs resources sure, zip it all together and share the .bas and .bmp etc.
The Smart Instal Maker is probably of interest to some readers of the forum. I would start a new post talking about how you did that. Step by step, what software do you need to down load, how easy is it to use, how do you package the .bas/.tkn/.exe But if you just want to play an show code that's fine too.
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Mar 28, 2020 11:14:07 GMT -5
how can you creat the .exe without folder (data, pictures, dll, tkn) ? any solfware for compile ? You can do that with the Enigma Virtual Box, I've tried it and it works. You can even compact everything but the TKN, so you can use as an alternative Runtime.exe.
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Apr 9, 2020 16:44:54 GMT -5
Hi, I've tried the game Mortar, but it's in Russian, right? it doesn't display the characters correctly since I need the cyrilic alphabet installed. I think I'm not sure.
|
|
timur77
Junior Member
Someday I will tell my grandsons that I am older than the Internet. And it will blow their brain.
Posts: 79
|
Post by timur77 on Apr 21, 2020 15:17:49 GMT -5
Hi, I've tried the game Mortar, but it's in Russian, right? it doesn't display the characters correctly since I need the cyrilic alphabet installed. I think I'm not sure. That's right, my native language is Russian. If you want, I will translate into English.
|
|
timur77
Junior Member
Someday I will tell my grandsons that I am older than the Internet. And it will blow their brain.
Posts: 79
|
Post by timur77 on Apr 21, 2020 15:33:08 GMT -5
Replace the Cyrillic code text with this code
'Mayhem! 'A Liberty BASIC Game 'Copyright 1995,2000 Carl Gundel and Steve Woodward
'Mayhem is a game where two tanks shoot at each other in a ramdomly 'generated landscape! Each tank's gun is aimed by inputting an 'angle from the horizon, and a number of pounds of TNT to propell a 'shell with.
'Note: There is nothing to force the players to 'take turns while playing.
'How to shoot '--------------------------------------------------------------------
'Pick an angle from 1 to 90 degrees of the horizon and input it. 'Then pick a quantity of pounds of TNT to use 1 - 20 (more or less) 'and input that. Then click on the fire button!
'Now if you miss, give the other chap a shot at you! And round you 'go!!!
'Modifying the game '--------------------------------------------------------------------
'When you get bored of Mayhem, add features to make it interesting. 'Try making it three players, or four! Make the ground invisible 'so that you have to hit it with a shell to 'feel' your way around it! 'Add some cool sound effects or a dramatic musical score! 'Try giving each player a limited number of shells, or a limited 'quantity of TNT. Or all of the above with a setup screen! Use your 'imagination, and then share your code with all of us!
'Special thanks to Steve Woodward for inspiring me to write this game!
dim terrain(700)
nomainwin
loadbmp "lefttank", "bmp\ltank3.bmp" loadbmp "righttank", "bmp\rtank3.bmp" loadbmp "leftbang", "bmp\lbang3.bmp" loadbmp "rightbang", "bmp\rbang3.bmp"
WindowWidth = 640 WindowHeight = 585 UpperLeftX = 10 UpperLeftY = 10 ChUSR=0 ChUSSR=0
menu #mayhem, "&Game", "&New game", [newGame], "&About the mortar!", [aboutMayhem], "&Exit", [exit] statictext #mayhem.statictext1, "Angle", 22, 486, 40, 20 textbox #mayhem.angleUsa, 70, 481, 100, 25 statictext #mayhem.statictext3, "Power", 22, 516, 26, 20 textbox #mayhem.tntUsa, 70, 511, 45, 25 button #mayhem.fu, "Fire!", [fireUsa], UL, 120, 511 statictext #mayhem.statictext2, "Angle", 322, 486, 40, 20 textbox #mayhem.angleUssr, 370, 481, 100, 25 statictext #mayhem.statictext4, "Power", 322, 516, 26, 20 textbox #mayhem.tntUssr, 370, 511, 45, 25 button #mayhem.fs, "Fire!", [fireUssr], UL, 420, 511 CHECKBOX #mayhem.cb1, "Auto fight", [AUsa], [MUsa], 185, 500, 100, 25 CHECKBOX #mayhem.cb2, "Auto fight", [AUssr], [MUssr], 485, 500, 100, 25 graphicbox #mayhem.graphics, 0, 0, 634, 480 open "Mortar!" for window_nf as #mayhem print #mayhem.angleUsa, "!setfocus" print #mayhem, "trapclose [exit]"
'ввод исходных данных для автобоя '#mayhem.angleUssr, "70" '#mayhem.tntUssr, "85" goto [newGame]
[MUssr] AUssr=0 #mayhem.angleUssr, "" #mayhem.tntUssr, "" wait [AUssr] AUssr=1 'поправка на ветер исходных данных для автобоя angle=70-windspeed*2 tnt=85+windspeed*2 xd=800'начальное значение места поподания для автобоя 'вывод поправленных исходных данных для автобоя #mayhem.angleUssr, angle #mayhem.tntUssr, tnt wait [MUsa] AUsa=0 #mayhem.angleUsa, "" #mayhem.tntUsa, "" wait [AUsa] AUsa=1 'поправка на ветер исходных данных для автобоя angle=70+windspeed*2 tnt=85-windspeed*2 xd2=800'начальное значение места поподания для автобоя 'вывод поправленных исходных данных для автобоя #mayhem.angleUsa, angle #mayhem.tntUsa, tnt wait
[newGame]
rate1 = rnd(1) / (rnd(1) * 20 + 10) rate2 = rnd(1) / (rnd(1) * 6 + 10) windspeed = int(rnd(1) * 18) - 9 usaX = int(rnd(1) * 100) + 25 ussrX = 609-int(rnd(1) * 100)
gosub [terr]
print #mayhem.graphics, "color white ; backcolor blue" print #mayhem.graphics, "place 550 15" print #mayhem.graphics, "\Score:" print #mayhem.graphics, "place 550 30" print #mayhem.graphics, "\USA -"; ChUSR print #mayhem.graphics, "place 550 45" print #mayhem.graphics, "\China -"; ChUSSR
print #mayhem.graphics, "place 10 15" if windspeed < 0 then print #mayhem.graphics, "\Wind <-"; abs(windspeed); " " if windspeed = 0 then print #mayhem.graphics, "\Wind ->0<-" if windspeed > 0 then print #mayhem.graphics, "\Wind "; windspeed; "->"
print #mayhem.graphics, "flush" print #mayhem.graphics, "segment" : input #mayhem, segId
'comment this line out for OS/2 'if Platform$ = "Windows" then playwave "tada.wav" if AUssr=1 Then 'поправка на ветер исходных данных для автобоя angle=70-windspeed*2 tnt=85+windspeed*2 xd=800'начальное значение места поподания для автобоя 'вывод поправленных исходных данных для автобоя #mayhem.angleUssr, angle #mayhem.tntUssr, tnt End If if AUsa=1 Then angle=70+windspeed*2 tnt=85-windspeed*2 xd2=800'начальное значение места поподания для автобоя 'вывод поправленных исходных данных для автобоя #mayhem.angleUsa, angle #mayhem.tntUsa, tnt End If
[main.inputLoop] 'wait here for input event if direction = 1 and AUssr=1 then goto [fireUssr]'автоход USSR if direction = -1 and AUsa=1 then goto [fireUsa]'автоход USA input aVar$ goto [main.inputLoop] '- - - - - - - - - - - - - - - - - [terr] print #mayhem.graphics, "cls ; fill blue ; down ; color brown ; size 1"
for x = 0 to 630 'step 1 holder1 = holder1 + rate1 holder2 = holder2 + rate2 holder3 = holder3 + sin(holder2) / 20 y = 350 + int(sin(holder1) * 75) + int(cos(holder2) * 30) + int(cos(holder3) * 10) terrain(x) = y ': terrain(x + 1) = y print #mayhem.graphics, "line "; x; " "; y; " "; x; " 510" next x
for x = usaX - 16 to usaX + 16 terrain(x) = terrain(usaX) - 8
print #mayhem.graphics, "color blue ; size 1" print #mayhem.graphics, "line "; x;" ";0;" ";x;" ";terrain(x) next x
print #mayhem.graphics, "drawbmp lefttank "; usaX - 16; " "; terrain(usaX) - 16;
for x = ussrX - 16 to ussrX + 16 terrain(x) = terrain(ussrX) - 8
print #mayhem.graphics, "color blue ; size 1" print #mayhem.graphics, "line "; x;" ";0;" ";x;" ";terrain(x) next x
print #mayhem.graphics, "drawbmp righttank "; ussrX - 16; " "; terrain(ussrX) - 16;
return '- - - - - - - - - - - - - - - - - [reterr]
print #mayhem.graphics, "color blue ; size 1" for x = explodeX-explodeSize/2 to explodeX+explodeSize/2 If x<0 Then xv=0 Else xv=x 'что бы не меньше 0 terrain(xv) = terrain(xv)+sqr((1+explodeSize/2)^2-(explodeX-x)^2) print #mayhem.graphics, "line ";x;" ";terrain(xv);" ";x;" ";terrain(xv)-sqr((1+explodeSize/2)^2-(explodeX-x)^2)-1 next x
print #mayhem.graphics, "color brown ; size 1" for x = 0 to 630 print #mayhem.graphics, "line ";x;" ";terrain(x);" ";x;" 510" next x
'print #mayhem.graphics, "color blue ; size 2" 'for x = explodeX-explodeSize/2 to explodeX+explodeSize/2 'If x<0 Then xv=0 Else xv=x 'что бы не меньше 0 'print #mayhem.graphics, "line ";x;" ";terrain(xv);" ";x;" ";terrain(x)-2*sqr((1+explodeSize/2)^2-(explodeX-x)^2) 'next x
for x = 0 to 630
next x
print #mayhem.graphics, "drawbmp lefttank "; usaX - 15; " "; terrain(usaX) - 16; for x = usaX - 15 to usaX + 15 : terrain(x) = terrain(usaX): next x
print #mayhem.graphics, "drawbmp righttank "; ussrX - 16; " "; terrain(ussrX) - 16; for x = ussrX - 15 to ussrX + 15 : terrain(x) = terrain(ussrX): next x return '- - - - - - - - - - - - - - - - - [fireUsa] 'the USA fires its gun!
print #mayhem.angleUsa, "!contents?" : input #mayhem.angleUsa, angle print #mayhem.tntUsa, "!contents?" : input #mayhem.tntUsa, tnt
if xd2<>800 Then tnt=Int(tnt+(ussrX-xd2+8)*((ussrX-xd2+8)<(xd2-usaX+8))/10)'автопоправка силы if AUsa=1 Then #mayhem.tntUsa, tnt 'запись новой силы if tnt <= 10 then notice "Are you a joker? Bet more!" goto [main.inputLoop] end if
direction = 1 x = usaX y = terrain(x) - 16
goto [trackShell] '- - - - - - - - - - - - - - - - - [fireUssr] 'the USSR fires its gun!
print #mayhem.angleUssr, "!contents?" : input #mayhem.angleUssr, angle print #mayhem.tntUssr, "!contents?" : input #mayhem.tntUssr, tnt
if xd<>800 Then tnt=Int(tnt+(xd-usaX+8)*((xd-usaX+8)<(ussrX+8-xd))/10)'автопоправка силы if AUssr=1 Then #mayhem.tntUssr, tnt 'запись новой силы
if tnt <= 10 then notice "Are you a joker? Bet more!" goto [main.inputLoop] end if
direction = -1 x = ussrX y = terrain(x) - 16
goto [trackShell] '- - - - - - - - - - - - - - - - - [trackShell]
live = 1 'индикатор жизни explode = 0 'метка подрыва
tnt = tnt '* 100 'скорость 'windEffect = windspeed / 50 'ветер angleXform = angle * 3.14 / 180 'градус 'xVelocity = (cos(angleXform) * tnt + 0.001) * direction 'дельта x 'yVelocity = sin(angleXform) * tnt + 0.001 'дельта y 'adjust = 3 / yVelocity 'if abs(xVelocity) > yVelocity then adjust = 3 / xVelocity * direction 'xVelocity = xVelocity * adjust * 2 'yVelocity = yVelocity * adjust * 2 lastX = 0 : lastY = 0 'прошлые координаты tt=0 'время
'print #mayhem.graphics, "rule xor" print #mayhem.graphics, "size 2" while live = 1 gosub [waitIfNeeded]
'x = x + xVelocity + windEffect 'y = y - yVelocity 'yVelocity = yVelocity - (32 * adjust) windEffect=tt*tt*windspeed/4 x1=x+tnt*tt*cos(angleXform)*direction+windEffect y1=y-tnt*tt*sin(angleXform)+5*tt*tt tt=tt+0.15
print #mayhem.graphics, "color white; size 2" print #mayhem.graphics, "place "; x1; " "; y1 print #mayhem.graphics, "go 1" if lastX = 0 then [firstTimeUsa] print #mayhem.graphics, "color darkgray" print #mayhem.graphics, "place "; lastX; " "; lastY print #mayhem.graphics, "go 1" [firstTimeUsa] lastX = x1 : lastY = y1 if x1 < 1 or x1 > 634 or y1>480 then live = 0 if live = 1 and y1 >= terrain(int(max(0,min(x1,634)))) then live = 0 : explode = 1 wend
if direction = -1 and AUssr=1 then xd=x1'прошлое поподание USSR if direction = 1 and AUsa=1 then xd2=x1'прошлое поподание USA 'print #mayhem.graphics, "discard ; flush"
scan
if explode = 0 then gosub [setFocus] : goto [main.inputLoop]
explodeX = x1 explodeY = y1 gosub [explosion]
gosub [setFocus]
if x1 >= usaX - 17 and x1 <= usaX + 17 then [explodeUsa] if x1 >= ussrX - 17 and x1 <= ussrX + 17 then [explodeUssr]
if direction = 1 and AUssr=1 then goto [fireUssr]'автоход USSR if direction = 1 and AUsa=1 then xd2=x1'прошлое поподание USA
goto [main.inputLoop] '- - - - - - - - - - - - - - - - - [setFocus] 'set the appropriate user's focus
if direction < 1 then print #mayhem.angleUsa, "!setfocus":print #mayhem.fs, "!Disable":print #mayhem.fu, "!Enable" else print #mayhem.angleUssr, "!setfocus":print #mayhem.fu, "!Disable":print #mayhem.fs, "!Enable" end if return '- - - - - - - - - - - - - - - - - [waitIfNeeded] 'keep the game from running too fast on fast machines
if tnt = 0 then tnt = 1 newTime = time$("milliseconds") while newTime < oldTime + (1500/(tnt)) newTime = time$("milliseconds") wend oldTime = newTime return '- - - - - - - - - - - - - - - - - [explosion] 'Make an explosion at explodeX explodeY
explodeRate = 2 explodeSpeed = explodeRate * 100
if hit = 0 then print #mayhem.graphics, "rule xor" print #mayhem.graphics, "size "; explodeRate print #mayhem.graphics, "place "; explodeX; " "; explodeY
if hit = 1 then explodeSize = 42 else explodeSize = 18
print #mayhem.graphics, "circle "; 6 - explodeRate for radius = 6 to explodeSize step explodeRate print #mayhem.graphics, "circle "; radius call pause print #mayhem.graphics, "circle "; radius - explodeRate next radius print #mayhem.graphics, "circle "; explodeSize print #mayhem.graphics, "rule over" print #mayhem.graphics, "discard"
'print #mayhem.graphics, "color blue" 'print #mayhem.graphics, "backcolor blue" 'print #mayhem.graphics, "circlefilled "; explodeSize
gosub [reterr]
return '- - - - - - - - - - - - - - - - - sub pause 'pause for a tenth of a second
start = time$("ms") while start + 20 > time$("ms") wend
end sub '- - - - - - - - - - - - - - - - - [explodeUsa] 'blow up the Usa tank
print #mayhem.graphics, "drawbmp leftbang "; usaX - 16; " "; terrain(usaX) - 16 print #mayhem.graphics, "delsegment "; segId now$ = time$() : while time$() = now$ : wend notice "China won this round!" ChUSSR=ChUSSR+1 goto [newGame] '- - - - - - - - - - - - - - - - - [explodeUssr] 'blow up the Ussr tank
print #mayhem.graphics, "drawbmp rightbang "; ussrX - 16; " "; terrain(ussrX) - 16 print #mayhem.graphics, "delsegment "; segId now$ = time$() : while time$() = now$ : wend notice "USA won this round!" ChUSR=ChUSR+1 goto [newGame] '- - - - - - - - - - - - - - - - - [aboutMayhem] 'Display an "About Mayhem!" dialog box
WindowWidth = 336 WindowHeight = 150
statictext #main.statictext1, "Миномет! - игра написаная на Liberty", 14, 16, 288, 20 statictext #main.statictext2, "BASIC и выпущена Carl Gundel и", 14, 36, 304, 20 statictext #main.statictext3, "Steve Woodward, 1995. Переделка Абдуллаев Т.", 14, 56, 168, 35 button #main, "OK", [aboutOK], UL, 254, 76, 50,20 open "About the mortar!" for dialog as #main print #main, "trapclose [aboutOK]"
goto [main.inputLoop] '- - - - - - - - - - - - - - - - - [aboutOK] 'Perform action for the button named 'aboutOK'
close #main
goto [main.inputLoop] '- - - - - - - - - - - - - - - - - [exit] 'Quit Mayhem!
confirm "Are you sure you want to go out?"; answer$ if answer$ <> "yes" then [main.inputLoop]
close #mayhem end '- - - - - - - - - - - - - - - - -
|
|