[Batch Game] Shoot 'em Batch

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Contact:

[Batch Game] Shoot 'em Batch

Post by MigrationUser »

31 Jan 2014 05:41
Honguito98

Shoot 'em in Batch

Well, this is my second post, and this is a game that first was developed by some user, called Jan Ringos, which, their game is programmed in C using the command console.

The more HARDER part to code has... All :?
First, I don´t have the original source code in C
Second, a bit hard to extract some audio effects and bgm's (background musics)
Third, assembly the code

I tried to make the 'copy', but in batch, of course, with some external commands, like Bg.exe, SoX.exe, Ansicon.exe.
Now, for make more easer, I developed some tools (examples codes) for automatized tasks, called:

Seta:GPU - Engine for Batch Games

Seta:DSP - Engine for music player for Batch Games

Seta:Core - Main core for functions like mouse, keyboard input, etc.

Chombie[-_-] - Technique and engine for extract frames from videos, then convert to ASCII Art

Credits:

Thanks To:
dbenham
jeb
Ed Dyreen
Aacini
(And all collaborators of Macros @ DosTips.com)

carlos ( again smile ) : for Bg.exe (I modified the source code for add the Seta:Core)

and... all the developers of commandline tools.

This is a bit of code:

Code: Select all

:    Shoot 'em Batch: An great example of batch capabiliies using Seta:Dsp, Seta:GPU And Chombie[-_-]
:    Copyright (C) 2012,2013  Honguito98, Jan Ringos
:
:    This program is free software: you can redistribute it and/or modify
:    it under the terms of the GNU General Public License as published by
:    the Free Software Foundation, either version 3 of the License, or
:    (at your option) any later version.
:
:    This program is distributed in the hope that it will be useful,
:    but WITHOUT ANY WARRANTY; without even the implied warranty of
:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
:    GNU General Public License for more details.
:
:    You should have received a copy of the GNU General Public License
:    along with this program.  If not, see README.TXT
@Echo off
	SetLocal EnableExtensions
	Set "Path=%comspec:~0,-8%;%comspec:~0,-8%\Wbem"
	Cd "%~dp0"
	Set Fn=Core\Fn.dll
	Title Shoot 'em Batch - Code Ported By Honguito98
	If /i "%1" Neq "LoadANSI" (
		%Fn% Maximize
		%Fn% Enablem
		Call :Flush
		Set "Game=%~0"
		Mode 80,50
		Echo.Shoot 'em Batch started
		For %%a in (
			""
			"Cheking Computer Specs ..."
			" Running On   : %Os%"
			" UserFolder   : %UserName%"
			" Processor    : %Processor_Identifier%"
			" Architecture : %Processor_Architecture%"
			" Cores        : %Number_Of_Processors%"
			" Level        : %Processor_Level%"
			" Revision     : %Processor_Revision%"
			""
		) Do (%Fn% Sleep 10 & Echo.%%~a)
		If "%Number_Of_Processors%" Lss "2" (
			Echo.ERROR -1: Cannot run on single core!
			Pause>Nul & Exit
		)
		If "%Number_Of_Processors%" Equ "2" (
			Echo.WARNING: May be slow on 2.10GHz or less 
		)
		If "%Number_Of_Processors%" Equ "3" (
			Echo.WARNING: May be slow on 2.20GHz or less 
		)
		If "%Number_Of_Processors%" Equ "4" (
			Echo.WARNING: May be slow on 2.40GHz or less 
		)
		If "%Number_Of_Processors%" Geq "5" (
			Echo.Congratulations! The game may be very faster
		)
		Echo.Loading ANSI Controller...
		Call :Stop
		Del "%Tmp%\StopSetaDSP" >Nul
		%Fn% Sleep 800
		Core\Ansi.dll "%~0" LoadANSI 2>Nul
		If Errorlevel 1 (
			Echo.ERROR 1: ANSI Controller Load Failure
			Pause>Nul & Exit
		)
		Exit
	)
	Echo.ANSI Controller Loaded
	Echo.Loading Data Code ...
	:: -> Setting Up Macros <- ::
	Set Xe=^^!
	:: WARNING! DON'T REMOVE THE NEXT TWO BLANK LINES
	Set LF=^


	Set "Mouse="
	Set "Err=^!Errorlevel^!"
	Set "Sprite=For %%. in (0;1) Do If %%. Equ 1 ("
	Set "Effect=For %%. in (0;1) Do If %%. Equ 1 ("
	Set "Tab="

	For /F "Skip=3 Tokens=1,* Delims=:" %%a in ('Find "@0:" "%Game%"') Do (
	Call Set "Sprite=%%Sprite%%%%b[#LineFeed#]"
	)
	For /F "Skip=3 Tokens=1,* Delims=:" %%a in ('Find "@2:" "%Game%"') Do (
	Call Set "Mouse=%%Mouse%%%%b[#LineFeed#]"
	)
	For /F "Skip=3 Tokens=1,* Delims=:" %%a in ('Find "@3:" "%Game%"') Do (
	Call Set "Effect=%%Effect%%%%b[#LineFeed#]"
	)
	For /F "Skip=3 Tokens=1,* Delims=:" %%a in ('Find "@4:" "%Game%"') Do (
	Call Set "Tab=%%Tab%%%%b[#LineFeed#]"
	)
	:: -> End Of Store Data <- ::
	SetLocal EnableDelayedExpansion
	Set ^"Sprite=!Sprite:[#LineFeed#]=^%LF%%LF%!"
	Set ^"Effect=!Effect:[#LineFeed#]=^%LF%%LF%!"
	Set ^"Mouse=!Mouse:[#LineFeed#]=^%LF%%LF%!"
	Set ^"Tab=!Tab:[#LineFeed#]=^%LF%%LF%!"

	Set "Sprite=!Sprite!) Else Set Args="
	Set "Effect=!Effect!) Else Set Args="
	Set "$Tmp=Core\Tmp"
	Set "Dip=<Nul Set/p="
	Set/a X=0,Y=0,Z=0,M=0,K=0
	!Fn! Cursor 0
	Rd /s /q !$Tmp! >Nul 2>&1
	Echo.Data Code Loaded...
		For /F "Tokens=*" %%g in ('Type Core\Settings.inf') Do Set "%%~g"
		For %%y in (Logo Intro Gear Shoot Help Score Star Like Triangle Circle Cube) Do Call :Seta_GPU %%y
	Echo.Loading Graphics...
	Set/a FramesCircle=198,FramesCube=234,FramesTriangle=172,FramesArmB=13
	For %%_ in (Circle Cube Triangle) Do (
	Set Count=0
	For /L %%a in (1,!SkipLoadFrame!,!Frames%%_!) do (
	Set/a Count+=1
	For /F "Delims=" %%b in ('Type !$Tmp!\%%_\[%%a]') Do (
		For %%z in (!Count!) Do Set "%%_[%%z]=!%%_[%%z]!%%~b"
	))
	Set/a Frames%%_=!Count!
	)
	For /L %%c in (1,1,13) Do (
		For /F "Delims=" %%a in ('Type !$Tmp!\Shoot\[%%c]') Do Set "ArmB[%%c]=!ArmB[%%c]!%%~a"
	)
	:: 80 Spaces = 10 tab ::
	:: 10x35 Lines        ::
	For /L %%x in (1,1,350) Do Set "Blank=!Blank!	"
	Set "Blank=[1;1H!Blank!"
	:: -> X.X_C = Figure Color  <- ::
	:: -> X.X_O = Figure Object <- ::
	
	Set S.G_C=[1;32m
	Set S.E_C=[1;37m
	Set S.R_C=[1;31m
	Set S.M_C=[1;35m
	Set C.G_C=[1;37m
	Set C.Y_C=[1;33m
	Set T.B_C=[1;36m
	Set H.Y_C=[1;33m
	Set H.R_C=[1;31m
	Set H.Y_O=ArmB
	Set H.R_O=ArmB
	Set S.G_O=Circle
	Set S.E_O=Circle
	Set S.R_O=Circle
	Set S.M_O=Circle
	Set C.G_O=Cube
	Set C.Y_O=Cube
	Set T.B_O=Triangle

	Set/a "Tmp_=(!Random!*43422/10+15)*4"
	Cmd /cexit !Tmp_!
	Echo.Loading Score Table ...
	:: ONLY FOR VIEW GLITCHES: @Echo off
	If Not Exist Core\Score.dat Call :GenScoreList
	Set "Chx=žÃ½¬±ýîóôöûü÷«		®¯¾Ð"
	Set "Header=.datÿshootÿ'emÿscoreÿdataÿ-ÿfileÿformatÿdevelopedÿbyÿhonguito98"
	For /F "Delims=" %%a in ('type Core\Score.dat') Do Set "Tmp_=%%a"
	Set Tmp_=!Tmp_:%Chx:~0,1%=a!&Set Tmp_=!Tmp_:%Chx:~19,1%=t!
	Set Tmp_=!Tmp_:%Chx:~1,1%=b!&Set Tmp_=!Tmp_:%Chx:~20,1%=u!
	Set Tmp_=!Tmp_:%Chx:~3,1%=c!&Set Tmp_=!Tmp_:%Chx:~18,1%=v!
	Set Tmp_=!Tmp_:%Chx:~2,1%=d!&Set Tmp_=!Tmp_:%Chx:~21,1%=w!
	Set Tmp_=!Tmp_:%Chx:~5,1%=e!&Set Tmp_=!Tmp_:%Chx:~24,1%=x!
	Set Tmp_=!Tmp_:%Chx:~6,1%=f!&Set Tmp_=!Tmp_:%Chx:~22,1%=y!
	Set Tmp_=!Tmp_:%Chx:~4,1%=g!&Set Tmp_=!Tmp_:%Chx:~25,1%=z!
	Set Tmp_=!Tmp_:%Chx:~7,1%=h!& Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~23,1%=1!
	Set Tmp_=!Tmp_:%Chx:~9,1%=i!& Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~26,1%=2!
	Set Tmp_=!Tmp_:%Chx:~10,1%=j!&Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~28,1%=3!
	Set Tmp_=!Tmp_:%Chx:~8,1%=k!& Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~27,1%=4!
	Set Tmp_=!Tmp_:%Chx:~12,1%=l!&Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~29,1%=5!
	Set Tmp_=!Tmp_:%Chx:~11,1%=m!&Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~30,1%=6!
	Set Tmp_=!Tmp_:%Chx:~14,1%=n!&Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~32,1%=7!
	Set Tmp_=!Tmp_:%Chx:~13,1%=p!&Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~33,1%=8!
	Set Tmp_=!Tmp_:%Chx:~15,1%=q!&Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~31,1%=9!
	Set Tmp_=!Tmp_:%Chx:~17,1%=r!&Set Tmp_=!Tmp_:%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~34,1%=0!
	Set Tmp_=!Tmp_:%Chx:~16,1%=s!&Set Tmp_=!Tmp_:%Chx:~43,1%= !
	Set Tmp_=!Tmp_:%Chx:~37,1%=[!&Set Tmp_=!Tmp_:%Chx:~35,1%=]!
	Set Tmp_=!Tmp_:%Chx:~38,1%=.!&Set Tmp_=!Tmp_:%Chx:~40,1%=o!
	Set Tmp_=!Tmp_:%Chx:~44,1%=ÿ!
	Set ^"Tmp_=!Tmp_:%Chx:~39,1%=^%LF%%LF%!"
	:: ONLY FOR VIEW GLITCHES: @Echo on
	Set/a Count=0,OkH=0,MaxOk=26
	Del !$Tmp!\TMP1.tmp >Nul 2>&1
	For /F "Delims=" %%z in ("!Tmp_!") Do (
		Set/a Count+=1
		Set _Tmp=%%z
		Echo;%%z>>!$Tmp!\TMP1.tmp
		If /i "!_Tmp:~0,5!" Equ "/size" Set Size=%%z
		If "%%z" Equ "!Header!" (Set Score[!Count!]=[0;30m&Set/a OkH+=1) Else (
		Set "Score[!Count!]=%%~z"
		)
		For %%x in (!Count!) Do (
			Set "Score[%%x]=!Score[%%x]:<:=[1;37m!"
			Set "Score[%%x]=!Score[%%x]:>:=[0;37m!"
			Set "Score[%%x]=!Score[%%x]:+:=[1;30m!"
		)
	)
	Set Tmp_=
	If !OkH! Lss !MaxOk! Call :GenScoreList
	For /F "Tokens=2 Delims=:" %%a in ("!Size!") Do Set Size=%%a
	For %%S in ("!$Tmp!\TMP1.tmp") Do If "!Size!" Neq "%%~zS" Call :GenScoreList
	Set Scount=!Count!
	Del !$Tmp!\TMP1.tmp >Nul 2>&1
	
	Echo.Loading Seta:DSP @ 0x!=Exitcode!
	Core\Dsp.dll --info Core\Stream.arc >Nul 2>&1 || (
		Echo.ERROR 2: Stream.arc not founded in \Core\
		Pause>Nul
		Exit
		)
		%Fn% Sleep 800
	Set "Dsp=!Tmp!\Seta_DSP.bat"
	For %%# in (
	"Shoot 00.000 00.528"
	"Bomb 01.061 01.512"
	"ShootShock1 01.621 02.301"
	"ShootShock2 02.383 03.016"
	"ShootShock3 03.091 03.667"
	"ShootShock4 03.729 04.514"
	"ShootShock5 04.583 05.006"
	"Boom1 05.058 06.318"
	"Boom2 06.388 08.619"
	"Boom3 08.679 10.798"
	"Boom4 10.885 12.646"
	"ToOutAmmo 12.753 12.963"
	"AmmoCharge 13.037 13.579"
	"OutAmmo 13.682 13.780"
	"Bonus 14.403 14.729"
	"Enter 28.891 29.089"

	"MediumLiveM 14.822 16.016"
	"DangerLiveM 16.135 17.733"
	"OutPriAmmoM 17.858 19.251"
	"OutSecAmmoM 19.368 20.760"
	"MediumLiveF 20.883 22.539"
	"DangerLiveF 22.649 24.304"
	"OutPriAmmoF 24.524 26.387"
	"OutSecAmmoF 26.510 28.668"

	"Intro 30.005 34.535 80.569"
	"GamePlay 81.069 96.419 142.447"
	) Do For /F "Tokens=1-4" %%a in ("%%~#") Do (
		Set "%%a=%%b %%c %%d"
		)
	::Set>Tmp.txt
	Cls & %Dip%[1;34m
	Call :Seta_DSP Intro
	For /L %%# in (486,1,625) Do (
		Type "!$Tmp!\Intro\[%%#]"
		!Fn! Locate 0 0
		)
	:MainMenu
	Set Lives_=
	Set MBar1=+-----------+    +--------------+    +------------+    +------+
	Set MBar2=Ý PLAY GAME Ý    Ý INSTRUCTIONS Ý    Ý HIGH SCORE Ý    Ý EXIT Ý
	Set/a CrdBX=8,LngBar=63,Mines=5,Ammunition=300,Lives=20,Score=0,Counter=0,StatusLive=2
	Set/a CrdBXM=CrdBX+LngBar
	For /L %%a in (1,1,!Lives!) Do Set Lives_=!Lives_!Ý
	Set MineR=ÝÝÝÝÝ
	Cls
	%Dip%[30;30H[1;33mBatch Version 0.5a[1;34m
	%Dip%[46;08H           Copyright (C) 2005, Developed By Jan Ringos
	%Dip%[47;08H        Copyright (C) 2013,2014 Ported Code By Honguito98
	%Dip%[48;05HBuilt on Seta:Core Seta:DSP, Seta:GPU, Chombie [-_-], SoX.exe and ZLIB1
	%Dip%[50;08H                     This game is freeware
	!Fn! Sprite 40 37 08 "+---+\n| \0f |\n+---+"
	:Menu
For /L %%# in (173,2,550) Do (

	%== Anim ==%
	If Not !Counter! Gtr 63 (
	Set/a Count2=LngBar-Counter,CrdBX2=CrdBX+LngBar-Counter,Count=Counter
	If !Count! Equ 0 Set Count=1
	If !CrdBX2! Equ 71 Set CrdBX2=70
	For /F "Tokens=1-2" %%a in ("!Counter! !Count!") Do (
	%Dip%[1;30m
	%Dip%[36;!CrdBX!H!MBar1:~0,%%a!
	%Dip%[37;!CrdBX2!H!MBar2:~-%%b!
	%Dip%[38;!CrdBX!H!MBar1:~0,%%a!
	Set/a Counter+=7
	))

	%== EXec ==%
	%Dip%[1;1H[1;36m
	Type "!$Tmp!\Logo\[%%#]"
	%Mouse%
	If !Y! Geq 35 If !Y! Leq 37 (

		If !X! Geq 8 If !X! Leq 19 (
		If !M! Equ 1 Goto :Play
			%Dip%[1;32m
			%Dip%[36;8H!MBar1:~0,13![37;8H!MBar2:~0,13![38;8H!MBar1:~0,13!
			Call
		)
		If !X! Geq 24 If !X! Leq 38 (
		If !M! Equ 1 Goto :Instructions
			%Dip%[1;34m
			%Dip%[36;25H!MBar1:~17,16![37;25H!MBar2:~17,16![38;25H!MBar1:~17,16!
			Call
		)
		If !X! Geq 44 If !X! Leq 57 (
		If !M! Equ 1 Goto :HighScore
			%Dip%[1;37m
			%Dip%[36;45H!MBar1:~37,14![37;45H!MBar2:~37,14![38;45H!MBar1:~37,14!
			Call
		)
		If !X! Geq 62 If !X! Leq 69 (
		If !M! Equ 1 Goto :Exit
			%Dip%[1;31m
			%Dip%[36;63H!MBar1:~55,9![37;63H!MBar2:~55,9![38;63H!MBar1:~55,9!
			Call
		)
	)
	If !X! Geq 37 If !X! Leq 40 If !Y! Geq 40 If !Y! Leq 42 (
	If !M! Equ 1 Goto :Settings
		!Fn! Sprite 40 37 0e "+---+\n| \0f |\n+---+"
		Call
	)
	If !Counter! Gtr 63 (
	If !Errorlevel! Equ 0 (
	%Dip%[1;30m[36;8H!MBar1![37;8H!MBar2![38;8H!MBar1!
	!Fn! Sprite 40 37 08 "+---+\n| \0f |\n+---+"
	Call 
	))

)
	Goto :Menu
:Instructions
	Cls
	%Effect% Enter
	For %%a in (
	"[1;37m[2;26HINSTRUCTIONS[0;37m"
	"[4;26H    Your goal is to destroy the falling objects"
	"[5;26Hbefore they reach the ground and to survive as long"
	"[6;26Has possible. The longer you survive, the more points"
	"[7;26Hyou will get. You will also get extra points for each"
	"[8;26Hobject destroyed."

	"[10;26H    Use your mouse to aim and fire. Primary button"
	"[11;26Hcontrols the Machine Guns, secondary is Mine Emitor."
	"[12;26HAmmunition informations are shown in the aiming box"
	"[13;26Hand in lower corners of the screen."


	"[16;26H[1;37mHEALTH[0;37m"
	"[17;26H"
	"[18;26H    When an object manages to get to the bottom grid"
	"[19;26Hit will explode decreasing your health. Bonuses and"
	"[20;26Hammo crates do not explode. Your health will increase"
	"[21;26Hevery time you destroy green diamond."
	"[22;26H    Watch your health bellow score indicator."
	
	"[28;3H[1;37mOBJECTS:[1;37m"

	"[30;8HBox & Sphere[0;37m - Easy to destroy (25 pts)."
	"[31;8H[1;30m                 Cause heavy damage."
	"[32;8H[1;35mSmall Sphere[0;37m - Easy to destroy (50 pts)."
	"[33;8H[1;30m                 Cause heavy damage."
	"[34;8H[1;32mArmor[0;37m        - Easy to destroy (200 pts)."
	"[35;8H[1;30m                 Cause heavy damage."
	"[36;8H[1;36mBonus[0;37m        - Easy to destroy (2000 pts)."
	"[37;8H[1;30m                 Cause heavy damage."
	"[38;8H[1;31mMine[0;37m         - Easy to destroy (1000 pts). Cause heavy damage."
	"[39;8H[1;30m                 Detonation destroys nearby objects and collects ammo."
	"[40;8H[1;33mAmmo[0;37m         - Easy to destroy (1000 pts). Cause heavy damage."
	"[41;8H[1;30m                 Carries 80 bullets, may contain extra mine."
	"[1;30m"
	"[45;69H+------+"
	"[46;69HÝ BACK Ý"
	"[47;69H+------+"
	) Do %Dip%%%~a
	:Instructions_
	For /L %%a in (1,2,110) Do (
	%Dip%[1;1H[1;32m
	Type !$Tmp!\Help\[%%a]
	%Mouse%
	If !K! Equ 27 Goto :MainMenu
	If !Y! Geq 44 If !Y! Leq 46 If !X! Geq 68 If !X! Leq 75 (
	If !M! Equ 1 (
		%Effect% Enter
		Goto :MainMenu
	)
		%Dip%[1;31m[45;69H+------+
		%Dip%[46;69HÝ BACK Ý
		%Dip%[47;69H+------+
		Call
	)
	If !Errorlevel! Equ 0 (
		%Dip%[1;30m[45;69H+------+
		%Dip%[46;69HÝ BACK Ý
		%Dip%[47;69H+------+
		Call 
	)
	)
	Goto :Instructions_

:HighScore
	Cls & %Effect% Enter
	::set>tmp.txt
	Set Tmp_=
	For /L %%a in (1,1,37) Do Set "Tmp_=!Tmp_! "
	For %%a in (
	"[1;25H[1;37m          HALL OF FAME"
	""
	"[3;25H[1;30m        The best players"
	""
	"[1;30m"
	"[44;41H+------+"
	"[45;41HÝ BACK Ý"
	"[46;41H+------+"
	""
	"[1;30m"
	"[17;70H+---+[21;70H+---+"
	"[18;70HÝ  Ý[22;70HÝ  Ý"
	"[19;70H+---+[23;70H+---+"
	) Do %Dip%%%~a
	Set/a Vmin=1,Vmax=34
	Call :ScL
	:HighScore_
	For /L %%a in (1,2,105) Do (
	%Dip%[1;1H[1;32m
	Type !$Tmp!\Like\[%%a]
	%Mouse%
	If !K! Equ 27 Goto :MainMenu
	If !Y! Geq 43 If !Y! Leq 45 If !X! Geq 40 If !X! Leq 46 (
		If !M! Equ 1 (
			%Effect% Enter
			Goto :MainMenu
		)
		%Dip%[1;31m[44;41H+------+
		%Dip%[45;41HÝ BACK Ý
		%Dip%[46;41H+------+
		Call
	)
	If !X! Geq 69 If !X! Leq 74 (
		If !Y! Geq 16 If !Y! Leq 18 (
			If !M! Equ 1 Call :ScL -
			Set M=0
			%Dip%[1;33m
			%Dip%[17;70H+---+
			%Dip%[18;70HÝ  Ý
			%Dip%[19;70H+---+
			Call
		)
		If !Y! Geq 20 If !Y! Leq 22 (
			If !M! Equ 1 Call :ScL +
			Set M=0
			%Dip%[1;33m
			%Dip%[21;70H+---+
			%Dip%[22;70HÝ  Ý
			%Dip%[23;70H+---+
			Call
		)
	)
	If !Errorlevel! Equ 0 (
		%Dip%[1;30m[44;41H+------+
		%Dip%[45;41HÝ BACK Ý
		%Dip%[46;41H+------+
		%Dip%[17;70H+---+[21;70H+---+
		%Dip%[18;70HÝ  Ý[22;70HÝ  Ý
		%Dip%[19;70H+---+[23;70H+---+
		Call 
	)
)
	Goto :HighScore_
:ScL [+/-]
	If "%1" Equ "+" If !Vmax! Lss !SCount! Set/a Vmin+=2,Vmax+=2
	If "%1" Equ "-" If !Vmin! Gtr 1 Set/a Vmin-=2,Vmax-=2
	Set Count=7
	For /L %%# in (!Vmin!,1,!Vmax!) Do (
		%Dip%[!Count!;25H[0;30m!Tmp_![!Count!;25H!Score[%%#]!
		Set/a Count+=1
	)
	Goto :Eof
	
:Settings
	Cls
	%Effect% Enter
	:Sett
	For %%a in (
	"[01;51H[1;31mSETTINGS:"
	"[04;46H[1;36m+---------------------------------+"
	"[05;46H[1;36mÝ Frame Skip:[0;37m      ÃÄÄÄÄÄÅÄÄÄÄ´   [1;36mÝ"
	"[06;46H[1;36m+---------------------------------+"
	"[09;46H[1;33m+---------------------------------+"
	"[10;46H[1;33mÝ Mouse Accuracy:[0;37m  ÃÄÄÄÄÄÅÄÄÄÄ´   [1;33mÝ"
	"[11;46H[1;33m+---------------------------------+"
	"[14;46H[1;32m+---------------------------------+"
	"[15;46H[1;32mÝ Voices:[0;37m     ( ) Male ( ) Female[1;32m Ý"
	"[16;46H[1;32m+---------------------------------+"
	

	"[27;03H[1;37mFRAME SKIP:"
	""
	"[29;03H[0;37mSet amount of frames to skip, eg:"
	"[30;03H[0;37mfor need more speed in game..."
	""
	"[32;03H[1;37mMOUSE ACCURACY:"
	"[34;03H[0;37mSet amount of precision for mouse pointer into console."
	"[35;03H[0;37mA higher number causes slowdowns."
	""
	"[37;03H[1;37mVOICES:"
	"[38;03H[0;37mSet type of voice."
	"[39;03H[0;37mSome peoples need change this because the voice sound"
	"[40;03H[0;37mis baffling."
	""
	"[05;78H[0;37m!FrameSkip!"
	"[10;77H!Accuracy!"
	"[45;65H[1;30m+------+"
	"[46;65H[1;30mÝ BACK Ý"
	"[47;65H[1;30m+------+"
	) Do %Dip%%%~a
	Set/a BarxFS=65,BarxAc=65
	For /L %%s in (1,1,!FrameSkip!) Do Set/a BarxFS+=1
	For /L %%s in (100,100,!Accuracy!) Do Set/a BarxAc+=1
	%Dip%[0;37m[05;!BarxFS!HÛ[10;!BarxAc!HÛ
	If /i !Gnr! Equ M %Dip%[0;37m[15;61H*
	If /i !Gnr! Equ F %Dip%[0;37m[15;70H*
	:Settings_
For /L %%# in (1,1,3) Do (
	%Dip%[1;1H[1;30m
	Type !$Tmp!\Gear\[%%#]
	%Mouse%
	If !X! Geq 65 If !X! Leq 74 If !M! Equ 1 (
		If !Y! Equ 4 (
			Set/a FrameSkip=0,M=0
			For /L %%a in (65,1,!X!) Do Set/a FrameSkip+=1
			Goto :Sett
		)
		If !Y! Equ 9 (
			Set/a Accuracy=0,M=0
			For /L %%a in (65,1,!X!) Do Set/a Accuracy+=100
			Goto :Sett
		)
	)
	If !Y! Equ 14 (
		If !M! Equ 1 (
		Set M=0
		If !X! Equ 60 Set Gnr=M
		If !X! Equ 69 Set Gnr=F
		Goto :Sett
		)
	)
	If !K! Equ 27 (Goto :Settings_Apply)
	If !Y! Geq 45 If !Y! Leq 47 If !X! Geq 65 If !X! Leq 73 (
	If !M! Equ 1 Goto :Settings_Apply_
		%Dip%[1;31m[45;65H+------+
		%Dip%[46;65HÝ BACK Ý
		%Dip%[47;65H+------+
		Call
	)
	If !Errorlevel! Equ 0 (
		%Dip%[1;30m[45;65H+------+
		%Dip%[46;65HÝ BACK Ý
		%Dip%[47;65H+------+
		Call 
	)
)
	Goto :Settings_
:Settings_Apply_
%Effect% Enter
:Settings_Apply
(
	Echo.;Settings Info Used By Shoot 'em Batch
	Echo.;Warning!: Don't Modify here the FrameSkip and Accuracy data
	Echo.FrameSkip=!FrameSkip!
	Echo.Accuracy=!Accuracy!
	Echo.SkipLoadFrame=!SkipLoadFrame!
	Echo.Gnr=!Gnr!
	)>"Core\Settings.inf"
	Set M=0
	Goto :MainMenu

:Exit
	%Effect% Enter
	%Dip%[0;37m
	Cls & Echo.Stoping Seta:DSP...
	Call :Stop
	Echo.Unloading variables...
	Rd /s /q !$Tmp! >Nul 2>&1
	Echo.Closing game...
	!Fn! Sleep 300
	Exit/b 0
:HallOfFame
	Cls
	!Fn! Cursor 100
	For %%a in (
	"[10;24H[1;37m^^^!^^^!^^^! YOU ARE IN HALL OF FAME ^^^!^^^!^^^!"
	"[16;34H>>>          <<<"
	"[16;38H!Score!"
	"[0;37m"
	"[23;24HAdd your nickname to High scores table."
	"[24;17HYou can provide short message to all, if you want to."
	"[1;30m"
	"[26;21HDo not forget to synchronize your score list^!"
	"[1;30m"
	"[41;38H+------+"
	"[42;38HÝ  OK  Ý"
	"[43;38H+------+"
	) Do %Dip%%%~a
	::         Y  X
	Set Camp1=30;32
	Set Camp2=34;32
	Set Camp3=35;33
	Set CurPos=!Camp1!
	Set Nickname=
	Set Message1=
	Set Message2=
	Set C=
	Set CCoun=1
	Call :Hall_
	:HallOfFame_
	For /L %%# in (1,2,111) Do (
	%Dip%[1;1H[1;33m
	Type !$Tmp!\Star\[%%#]
	%Dip%[!CurPos!H[!CurPos!H[!CurPos!H
	%Mouse%
	If Defined KeyChar Set "KeyChar=!KeyChar:~1,1!"
	For %%a in (13 8 92 124 37 38 33 34 42 43 47 94 60 62 58 91 93) Do If !KeyCode! Equ %%a Set "KeyChar="
	If !KeyCode! Equ 32 Set "KeyChar=ÿ"
	If !KeyCode! Equ 13 (
		If !CCount! Geq 3 Set CCount=0
		Set/a CCount+=1
		For %%p in (!CCount!) Do Set "CurPos=!Camp%%p!"
	)
	If "!CurPos!" Equ "30;32" (
		If Defined KeyChar (Set "NickName=!NickName!!KeyChar!"&Set "NickName=!NickName:~0,17!")
		If !KeyCode! Equ 8 If Defined NickName Set "NickName=!NickName:~0,-1!"
		Call :Hall_
	)
	If "!CurPos!" Equ "34;32" (
		If Defined KeyChar (Set "Message1=!Message1!!KeyChar!"&Set "Message1=!Message1:~0,33!")
		If !KeyCode! Equ 8 If Defined Message1 Set "Message1=!Message1:~0,-1!"
		Call :Hall_
	)
	If "!CurPos!" Equ "35;33" (
		If Defined KeyChar (Set "Message2=!Message2!!KeyChar!"&Set "Message2=!Message2:~0,33!")
		If !KeyCode! Equ 8 If Defined Message2 Set "Message2=!Message2:~0,-1!"
		Call :Hall_
	)
	If !Y! Geq 40 If !Y! Leq 42 If !X! Geq 37 If !X! Leq 45 (
		If !M! Equ 1 Goto :SetScore
		%Dip%[1;32m
		%Dip%[41;38H+------+
		%Dip%[42;38HÝ  OK  Ý
		%Dip%[43;38H+------+
		Call 
	)
	If !Errorlevel! Equ 1 (
		%Dip%[1;30m
		%Dip%[41;38H+------+
		%Dip%[42;38HÝ  OK  Ý
		%Dip%[43;38H+------+
		Call
	)
	Set C=&Set K=0&Set Chr=
)
	Goto :HallOfFame_
:Hall_
	For %%a in (
	"[1;36m"
	"[29;20H          +-------------------+"
	"[30;20HNickname: Ý                   Ý"
	"[31;20H          +-------------------+"
	""
	"[33;20H          +-------------------------------------+"
	"[34;20H Message: Ý                                   < Ý"
	"[35;20H          Ý >                                   Ý"
	"[36;20H          +-------------------------------------+"
	"[1;37m[30;32H!Nickname![34;33H!Message1![35;33H!Message2!"
	) Do %Dip%%%~a
	Goto :Eof
:SetScore
	!Fn! Cursor 0
	%Dip%[38;19H[1;31mLOADING .
	Set/a Ln1=0,Ln2=0,Ln3=0
	For /L %%a in (2,1,102) Do (
		If !Place! Equ %%a (
			Set/a Ln1=%%a,Ln2=%%a+1,Ln3=%%a+2
			Set Score[!Ln1!]=[1;37m!Place_!.ÿÿ!NickName!ÿ[!Score!]
			Set Score[!Ln2!]=[0;37mÿÿÿÿÿÿ!Message1!
			Set Score[!Ln3!]=[1;30mÿÿÿÿÿÿÿÿ!Message2!
		)
	)
	%Dip%.
	For /L %%b in (3,1,102) Do (
		If "!Score[%%b]!" Equ "[0;30m" (Set Tmp_=!Header!) Else (
			For /F "Tokens=1* Delims=m" %%x in ("!Score[%%b]!") Do (
				If /i "%%x" Equ "[1;37" Set "Tmp_=<:%%y"
				If /i "%%x" Equ "[0;37" Set "Tmp_=>:%%y"
				If /i "%%x" Equ "[1;30" Set "Tmp_=+:%%y"
			)
		)
	Echo;!Tmp_!>>!$Tmp!\$core.tmp
	)
	%Dip%.
	For %%S in (!$Tmp!\$core.tmp) Do Set "Size=%%~zS"
	Call :GetLg Size
	Set/a Size=Size+Count+63+6+4
	:: sum size+sizeofstring+headersize+sizeofstringsize+twoCRLFs
	:: Header Size: 63 bytes
	For %%t in (
	"!Header!"
	"/size:!Size!"
	) Do Echo;%%~t>>!$Tmp!\Header.bin
	Copy /b /y !$Tmp!\Header.bin + !$Tmp!\$core.tmp !$Tmp!\TMP$.tmp>Nul 2>&1
	Del !$Tmp!\Header.bin >Nul 2>&1
	Del !$Tmp!\$core.tmp >Nul 2>&1
	%Dip%.
	For /F "Delims=" %%y in ('Type !$Tmp!\TMP$.tmp') Do (
	Set "Tmp_=%%y"
	Set Tmp_=!Tmp_:a=%Chx:~0,1%!&Set Tmp_=!Tmp_:t=%Chx:~19,1%!
	Set Tmp_=!Tmp_:b=%Chx:~1,1%!&Set Tmp_=!Tmp_:u=%Chx:~20,1%!
	Set Tmp_=!Tmp_:c=%Chx:~3,1%!&Set Tmp_=!Tmp_:v=%Chx:~18,1%!
	Set Tmp_=!Tmp_:d=%Chx:~2,1%!&Set Tmp_=!Tmp_:w=%Chx:~21,1%!
	Set Tmp_=!Tmp_:e=%Chx:~5,1%!&Set Tmp_=!Tmp_:x=%Chx:~24,1%!
	Set Tmp_=!Tmp_:f=%Chx:~6,1%!&Set Tmp_=!Tmp_:y=%Chx:~22,1%!
	Set Tmp_=!Tmp_:g=%Chx:~4,1%!&Set Tmp_=!Tmp_:z=%Chx:~25,1%!
	Set Tmp_=!Tmp_:h=%Chx:~7,1%!& Set Tmp_=!Tmp_:1=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~23,1%!
	Set Tmp_=!Tmp_:i=%Chx:~9,1%!& Set Tmp_=!Tmp_:2=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~26,1%!
	Set Tmp_=!Tmp_:j=%Chx:~10,1%!&Set Tmp_=!Tmp_:3=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~28,1%!
	Set Tmp_=!Tmp_:k=%Chx:~8,1%!& Set Tmp_=!Tmp_:4=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~27,1%!
	Set Tmp_=!Tmp_:l=%Chx:~12,1%!&Set Tmp_=!Tmp_:5=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~29,1%!
	Set Tmp_=!Tmp_:m=%Chx:~11,1%!&Set Tmp_=!Tmp_:6=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~30,1%!
	Set Tmp_=!Tmp_:n=%Chx:~14,1%!&Set Tmp_=!Tmp_:7=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~32,1%!
	Set Tmp_=!Tmp_:p=%Chx:~13,1%!&Set Tmp_=!Tmp_:8=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~33,1%!
	Set Tmp_=!Tmp_:q=%Chx:~15,1%!&Set Tmp_=!Tmp_:9=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~31,1%!
	Set Tmp_=!Tmp_:r=%Chx:~17,1%!&Set Tmp_=!Tmp_:0=%Chx:~41,1%%Chx:~36,1%%Chx:~42,1%%Chx:~34,1%!
	Set Tmp_=!Tmp_:s=%Chx:~16,1%!&Set Tmp_=!Tmp_: =%Chx:~43,1%!
	Set Tmp_=!Tmp_:[=%Chx:~37,1%!&Set Tmp_=!Tmp_:]=%Chx:~35,1%!
	Set Tmp_=!Tmp_:.=%Chx:~38,1%!&Set Tmp_=!Tmp_:o=%Chx:~40,1%!
	Set Tmp_=!Tmp_:ÿ=%Chx:~44,1%!
	%Dip%!Tmp_!!Chx:~39,1!>>!$Tmp!\Score.tmp
	)
	%Dip%.
	Del !$Tmp!\TMP$.tmp >Nul 2>&1
	Move /y !$Tmp!\Score.tmp Core\Score.dat
	%Dip%.
	Goto :YourScore
:GetLg
	Set Tmp_=!%~1!
	Set Count=0
	:GetLg_
	Set/a Count+=1
	Set Tmp_=!Tmp_:~1!
	If Defined Tmp_ Goto :GetLg_
	Goto :Eof

:YourScore
	Cls & %Effect% Enter
	If !Score! Geq 250000 Set Slogan=[20;22HUnbelievable^! How did you do that???
	If !Score! Lss 150000 Set Slogan=[20;29HWow. Can you join to the army?
	If !Score! Lss 75000 Set Slogan=[20;25HOnly few get stay in hall of fame.
	If !Score! Lss 55000 Set Slogan=[20;18HI am sure you are able to get more points.
	If !Score! Lss 35000 Set Slogan=[20;18HTrainer monkey is able to get more points.
	If !Score! Lss 15000 Set Slogan=[20;29HYou wanted to loose, don't you?
	%Dip%[0;37m!Slogan!
	Set/a "FAc=(BHit*100)/BFired,MAc=(MHit*100)/MFired,ArmorCol=(ObjTotalArmor*1000)/ObjHitArmor"
	For %%a in (
	"[1;37m"
	"[19;34H>>>          <<<"
	""
	"[21;35HGame Statics" "[0;37m"
	"[23;12H Bullets hit/fired:                Objects destroyed:            "
	"[1;30m"
	"[24;12H     Fire accuracy:    %%"
	"[0;37m"
	"[25;12H                                             Spheres:          "
	"[26;12HMines hit/released:                            Boxes:          "
	"[1;30m"
	"[27;12H     Mine accuracy:    %%                       [0;37mMines:          "
	""
	"[29;12HTime points gained:                   Armor diamonds:          "
	"[30;12H      Bonus points:                          Bonuses:          "
	"[31;12H                                          Ammo packs:          "
	"[32;12H   Armor collected:     %%"
	""
	"[1;30m"
	"[35;37H+------+"
	"[36;37HÝ  OK  Ý"
	"[37;37H+------+"
	""
	"[0;37m"
	"[19;38H!Score!"
	"[23;32H!BHit! / !BFired![23;66H!ObjHit! / !ObjTotal!"
	"[24;32H[1;30m!FAc![0;37m"
	"[25;66H!ObjHitSp! / !ObjTotalSp![26;66H!ObjHitSp! / !ObjTotalSp!"
	"[26;32H!MHit! / !MFired!"
	"[27;32H[1;30m!MAc![0;37m[27;66H!ObjHitMine! / !ObjTotalMine!"
	"[29;32H!TimePoints![29;66H!ObjHitArmor! / !ObjTotalArmor!"
	"[30;32H!BonusPoints![30;66H!ObjHitBonus! / !ObjTotalBonus!"
	"[31;66H!ObjHitAmmo! / !ObjTotalAmmo!"
	"[32;32H!ArmorCol!"
	) Do %Dip%%%~a
	:YS_
	For /L %%# in (1,2,377) Do (
		%Dip%[1;1H[1;34m
		Type !$Tmp!\Score\[%%#]
		%Mouse%

		If !Y! Geq 34 If !Y! Leq 36 If !X! Geq 36 If !X! Leq 44 (
			If !M! Equ 1 Goto :HighScore
			%Dip%[1;32m
			%Dip%[35;37H+------+
			%Dip%[36;37HÝ  OK  Ý
			%Dip%[37;37H+------+
			Call
		)
		If !Errorlevel! Equ 0 (
			%Dip%[1;30m
			%Dip%[35;37H+------+
			%Dip%[36;37HÝ  OK  Ý
			%Dip%[37;37H+------+
			Call 
		)
	)
	Goto :YS_


	

:Play
	Set BackGround=&Cls
	For /F "Delims=" %%a in ('Type Core\Background.bg') Do Set "BackGround=!BackGround!%%~a"
	Call :Stop
	%Effect% Enter
	!Fn! Sprite 36 0 !BackGround!
	For %%a in (C.Y C.G S.G S.R S.M S.E T.B H.Y H.R) Do Set %%a_Cr=
	Set/a M=0,MaxPosSp=36,SpeedGen=50,Score=0,NextSprite=0,Clock=0
	Set/a BHit=0,BFired=0,BAc=0,MHit=0,MFired=0,MAc=0,ObjTotal=0,ObjHit=0,ObjHitSp=0,ObjTotalSp=0
	Set/a ObjHitMine=0,ObjTotalMine=0,ObjHitArmor=0,ObjTotalArmor=0,ObjTotalBonus=0,ObjHitBonus=0
	Set/a ObjTotalAmmo=0,ObjHitAmmo=0,Timepoints=0,Bonuspoints=0,ArmorCol=0
	Set Destroy=No
	Set Refresh=No
	Set Ef=None
	Set Tp=0
	Set/a Rnd=!Random!%%8
	If !Rnd! Equ 0 Set Tip=Also your mines will explode if you hit them.
	If !Rnd! Equ 1 Set Tip=The longer you survive the more points you'll get.
	If !Rnd! Equ 2 Set Tip=Conserve your ammo in the beginning of the game.
	If !Rnd! Equ 3 Set Tip=Later in game, focus to diamonds and bonuses only.
	If !Rnd! Equ 4 Set Tip=Try to catch the objects as soon as they appear.
	If !Rnd! Equ 5 Set Tip=Collect ammo first before detonating nearby mines.
	If !Rnd! Equ 6 Set Tip=Try to collect bonuses first before detonating mines.
	If !Rnd! Equ 7 Set Tip=Ladies, switch to male narrator in settings menu.
	Call :Seta_DSP GamePlay
	!Fn! Cursor 0
	Set List=;
	%Tab%
	:Play_Loop
	:: -> Main Loop <- ::
	
	FOR /L %%! IN (1,1,500) DO (
	If "!Lives_!" Equ "ÝÝÝÝÝÝÝÝÝÝ" (
		Set StatusLive=2
		Set Adv3=Yes
	)
	If "!Lives_!" Equ "ÝÝÝÝÝÝÝÝÝ" (
		Set StatusLive=3
		If "!Adv3!" Equ "Yes" (Set Adv3=No&%Effect% MediumLive!Gnr!)
	)
	If "!Lives_!" Equ "ÝÝÝÝÝ" (
		Set StatusLive=3
		Set Adv4=Yes
	)
	If "!Lives_!" Equ "ÝÝÝÝ" (
		Set StatusLive=1
		If "!Adv4!" Equ "Yes" (Set Adv4=No&%Effect% DangerLive!Gnr!)
	)
	If Not Defined Lives_ Goto :GameOver
	
	%Mouse%
	If !KeyCode! Equ 27 Goto :Reset
	If !M! Equ 1 (
		If !Ammunition! Neq 0 (
			For %%_ in (80 60 40 20) Do If !Ammunition! Equ %%_ %Effect% ToOutAmmo
			Set/a X+=1,Y+=1,BFired+=1
			Set "H.Y_Cr=!H.Y_Cr!!X!.!Y!,"
			Set/a Ammunition-=5
			Set Adv2=Yes
			%Effect% Shoot
		) Else (
		If "!Adv2!" Equ "Yes" (Set Adv2=No&%Effect% OutPriAmmo!Gnr!)
		%Effect% OutAmmo
		)
	)
	If !M! Equ 2 (
		If !Mines! Neq 0 (
			If "!MineR!" Equ "ÝÝÝÝÝ" (
				Set/a X+=1,Y+=1,Mines-=1,MFired+=1
				Set "H.R_Cr=!H.R_Cr!!X!.!Y!,"
				Set MineR=
				Set Adv=Yes
				%Effect% Bomb
			)
		) Else (
		If "!Adv!" Equ "Yes" (Set Adv=No&%Effect% OutSecAmmo!Gnr!)
		)
	)
	REM Set M=0
	set/a NextSprite+=1,Score+=2,Clock+=1,TimePoints+=5,Tp+=1
	If !Tp! Equ 1  %Dip%[0;37m[15;15HTip: [1;37m!Tip!
	If !Tp! Equ 35 %Dip%[0;37m[15;15HTip: [0;37m!Tip!
	If !Tp! Equ 37 %Dip%[1;30m[15;15HTip: [1;30m!Tip!
	If !Tp! Equ 39 %Dip%[0;30m[15;15HTip: [0;30m!Tip!
	
	If !Tp! Equ 1  %Dip%[1;37m[10;32H^^!^^!^^! GET READY ^^!^^!^^!
	If !Tp! Equ 25 %Dip%[0;37m[10;32H^^!^^!^^! GET READY ^^!^^!^^!
	If !Tp! Equ 27 %Dip%[1;30m[10;32H^^!^^!^^! GET READY ^^!^^!^^!
	If !Tp! Equ 29 %Dip%[0;30m[10;32H^^!^^!^^! GET READY ^^!^^!^^!
	For %%t in (
	50 100 150 200 250 300 350
	400 450 500 550 600 650 700 750
	800 850 900 1200 1300 1400 1500
	) Do If !Clock! Equ %%t Set/a SpeedGen-=2
	If Defined H.Y_Cr Set/a H.Y_F+=2
	If Defined H.R_Cr Set/a H.R_F+=1
	If "!MineR!" Neq "ÝÝÝÝÝ" Set/a M.C+=1
	If !M.C! Geq 10 (Set MineR=!MineR!Ý&Set M.C=0)
	If !NextSprite! Geq !SpeedGen! (
		Set/a Rnd=!Random!%%19,_X=!Random!*50/32768,_Y=1
		If !Rnd! Equ 0 Set C.Y_Cr=!C.Y_Cr!!_X!.!_Y!,&Set/a ObjTotalAmmo+=1
		If !Rnd! Equ 1 Set C.G_Cr=!C.G_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 2 Set C.G_Cr=!C.G_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 3 Set C.G_Cr=!C.G_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 4 Set C.G_Cr=!C.G_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 5 Set C.G_Cr=!C.G_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 6 Set S.G_Cr=!S.G_Cr!!_X!.!_Y!,&Set/a ObjTotalArmor+=1
		If !Rnd! Equ 7 Set S.E_Cr=!S.E_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 8 Set S.E_Cr=!S.E_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 9 Set S.E_Cr=!S.E_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 10 Set S.E_Cr=!S.E_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 11 Set S.E_Cr=!S.E_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 12 Set S.R_Cr=!S.R_Cr!!_X!.!_Y!,&Set/a ObjTotalMine+=1
		If !Rnd! Equ 13 Set S.M_Cr=!S.M_Cr!!_X!.!_Y!,&Set/a ObjTotalSp+=1
		If !Rnd! Equ 14 Set T.B_Cr=!T.B_Cr!!_X!.!_Y!,&Set/a ObjTotalBonus+=1
		If !Rnd! Equ 15 Set T.B_Cr=!T.B_Cr!!_X!.!_Y!,&Set/a ObjTotalBonus+=1
		If !Rnd! Equ 16 Set T.B_Cr=!T.B_Cr!!_X!.!_Y!,&Set/a ObjTotalBonus+=1
		If !Rnd! Equ 17 Set T.B_Cr=!T.B_Cr!!_X!.!_Y!,&Set/a ObjTotalBonus+=1
		If !Rnd! Equ 18 Set T.B_Cr=!T.B_Cr!!_X!.!_Y!,&Set/a ObjTotalBonus+=1
		Set/a NextSprite=0,ObjTotal+=1
	)
	For %%a in (C.Y;C.G;S.G;S.R;S.M;S.E;T.B;H.Y;H.R) Do (
		If Defined %%a_Cr (
			Set "List=!List:%%a;=!%%a;"
		)
	)
	
For %%a in (!List!) Do (
	 For %%c in (!%%a_Cr!) Do (
		For /F "Tokens=1-2 Delims=." %%d in ("%%c") Do (
			Set/a X1=%%d,Y1=%%e,Y2=%%e+1,Y3=%%e+2,Y4=%%e+3,Y5=%%e+4,Y6=%%e+5,Y7=%%e+6,Y8=%%e+7,Y9=%%e+8,Y10=%%e+9,Y11=%%e+10,Y12=%%e+11,Y13=%%e+12,Y14=%%e+13,Y15=%%e+14
			For /F "Tokens=1-2" %%p in ("!%%a_F! !%%a_O!") Do (
				For %%t in ("!%%q[%%p]!") Do <Nul Set/p=!%%a_C!%%~t
				Set/a _Y=%%e+1
				If %%a Neq H.Y (
					If %%a Neq H.R (
						Set/a %%a_F+=!FrameSkip!
				)	)
				For %%f in (!%%a_O!) Do (
					If !%%a_F! Geq !Frames%%f! (
						Set %%a_F=1
						If %%a_Cr Equ H.Y_Cr (
							Set %%a_F=13
							If %%e Geq 38 Set Refresh=Yes
							Set "List=!List:%%a;=!"
							Set %%a_Cr=
							For %%k in (C.Y C.G S.G S.R S.M S.E T.B) Do (
								For %%w in (!%%k_Cr!) Do (
									For /F "Tokens=1-2 Delims=." %%x in ("%%w") Do (
										Set/a _X=%%x+20,_Y=%%y+15,__X=%%d+9,__Y=%%e+6
										If %%d Geq %%x If !__X! Leq !_X! If %%e Geq %%y If !__Y! Leq !_Y! (
											<Nul Set/p=[0;30m!Blank!
											!Fn! Sprite 36 0 !BackGround!
											Set %%k_Cr=!%%k_Cr:%%x.%%y,=!
											Set "List=!List:%%k;=!"
											Set Ef=Obj
											If %%k Equ T.B Set Ef=Bonus
											If %%k Equ S.G Set Ef=Armor
											If %%k Equ S.M Set Ef=Small
											If %%k Equ S.R Set Ef=Bomb
											If %%k Equ C.Y Set Ef=Ammo
						)	)	)	)	)
						If %%a_Cr Equ H.R_Cr (
							Set %%a_F=13
							If %%e Geq 38 Set Refresh=Yes
								Set/a Ammunition+=80
								For %%k in (C.Y C.G S.G S.R S.M S.E T.B H.Y H.R) Do Set %%k_Cr=
								Set "List=;"
								Set Ef=Bomb
								<Nul Set/p=[0;30m!Blank!
								!Fn! Sprite 36 0 !BackGround!
					)	)	)
				If %%a_Cr Neq H.Y_Cr If %%a_Cr Neq H.R_Cr (
					If !_Y! Geq !MaxPosSp! (Set %%a_Cr=!%%a_Cr:%%c,=!&Set Destroy=Yes&Set "List=!List:%%a;=!") Else (
						For %%t in (!_Y!) Do Set %%a_Cr=!%%a_Cr:%%c,=%%d.%%t,!
)	)	)		)	)

	
		If /i "!Destroy!" Equ "Yes" (
			Set Destroy=No
			%Effect% Boom1
			!Fn! Sprite 36 0 !BackGround!
			Set "Lives_=!Lives_:~1!"
		)
		If /i "!Refresh!" Equ "Yes" (
			Set Refresh=No
			!Fn! Sprite 36 0 !BackGround!
		)
		If /i "!Ef!" Equ "Obj" (
			Set Ef=None
			Set/a Rnd=!Random!%%4+1,Score+=25,BHit+=1,ObjHit+=1,ObjHitSp+=1
			%Effect% ShootShock!Rnd!
			%Effect% Boom4
		)
		If /i "!Ef!" Equ "Bomb" (
			Set Ef=None
			Set/a Score+=1000,MHit+=1,ObjHit+=1,ObjHitMine+=1,MFired+=1
			%Effect% ShootShock
			%Effect% Boom2
			For %%a in (C.Y C.G S.G S.R S.M S.E T.B H.Y H.R) Do Set %%a_Cr=
			%Dip%[0;30m!Blank!
			!Fn! Sprite 36 0 !BackGround!
		)
		If /i "!Ef!" Equ "Small" (
			Set Ef=None
			Set/a Score+=50,BHit+=1,ObjHit+=1,ObjHitSp+=1
			%Effect% ShootShock
			%Effect% Boom1
		)
		If /i "!Ef!" Equ "Bonus" (
			Set Ef=None
			Set/a Rnd=!Random!%%8
			If !Rnd! Equ 6 Set/a Mines+=1
			Set/a Score+=2000,BHit+=1,ObjHit+=1,ObjHitBonus+=1,BonusPoints+=2000
			%Effect% Bonus
		)
		If /i "!Ef!" Equ "Armor" (
			Set Ef=None
			Set/a Score+=200,BHit+=1,ObjHit+=1,ObjHitArmor+=1
			If "!Lives_!" Neq "ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ" Set Lives_=!Lives_!Ý
			%Effect% Bonus
		)
		If /i "!Ef!" Equ "Ammo" (
			Set Ef=None
			Set/a Score+=1000,Ammunition+=80,BHit+=1,ObjHit+=1,ObjHitAmmo+=1
			%Effect% AmmoCharge
		)
	)
	If !H.Y_F! Geq 13 Set H.Y_F=1
	If !H.R_F! Geq 13 Set H.R_F=1
	%Tab%

)
	Goto :Play_Loop
:Reset
	Cls & Call :Stop
	Call :Seta_DSP Intro
	Goto :MainMenu
:GameOver
	Cls & Call :Stop
	Call :Seta_DSP Intro
	Set Place_=0
	For /L %%a in (1,1,4) Do %Effect% Boom%%a
	For /L %%# in (3,4,99) Do (
		For /F "Tokens=3 Delims=[]" %%a in ("!Score[%%#]!") Do (
			Set/a Place_+=1
			If !Score! Geq %%a (Set Place=%%#&Goto :HallOfFame)
		)
	)
	Goto :YourScore
	
:Seta_DSP
	For /F "Tokens=1-3" %%a In ("!%~1!") Do Set I=%%a& Set N=%%b& Set F=%%c
(
	Echo;@Echo Off
	Echo;SetLocal EnableExtensions
	Echo;Rem Title Seta:DSP
	Echo;Set I=!I!
	Echo;Set N=!N!
	Echo;Set F=!F!
	Echo;Echo;Seta:DSP - Developed By Honguito98
	Echo;Echo;Debug info: sound offset:
	Echo;Echo;Init = !I!  Loop = !N!  EndLoop = !F!
	Echo;For /F "Tokens=1-6 Delims=." %%%%a in ("%%I%%.%%N%%.%%F%%"^) Do (
	Echo;	Set _I=%%%%a%%%%b
	Echo;	Set _N=%%%%c%%%%d
	Echo;	Set _F=%%%%e%%%%f
	Echo;^)
	Echo;Set/a "S1=%%_N%%-%%_I%%,S2=(%%_F%%-%%_N%%)*5"
	Echo;Echo;Times To Repeat: 5 [%%S2%%]
	Echo;Start "" /B Cmd /C "Core\Dsp.dll Core\Stream.arc -d trim %%I%% =%%N%%"
	Echo;Core\Fn.dll Sleep %%S1%%
	Echo;If Exist "%%Tmp%%\StopSetaDSP" (Del "%%Tmp%%\StopSetaDSP" ^& Exit^)
	Echo;:Loop
	Echo;Start "" /B Cmd /C Core\Dsp.dll Core\Stream.arc -d trim %%N%% =%%F%% repeat 4
	Echo;Core\Fn.dll Sleep %%S2%%
	Echo;If Exist "%%Tmp%%\StopSetaDSP" (Del "%%Tmp%%\StopSetaDSP" ^& Exit^)
	Echo;Goto :Loop
	)>"!Dsp!"
	(Start "" /B Cmd /c "!Dsp!") >Nul 2>&1
	Goto :Eof
:Seta_GPU
	For %%R in ("Core\%~1.r3d") Do (
	Md "!$Tmp!\%%~nR"
	Copy /y "Core\%~1.r3d" "!$Tmp!\%%~nR\$Tmp.exe" >Nul 2>&1
	Pushd "!Cd!"
	Cd "!$Tmp!\%%~nR"
	$Tmp >Nul 2>&1
	Del $Tmp.exe >Nul 2>&1
	Popd
	)
	Goto :Eof
:Stop
	Echo;>"%Tmp%\StopSetaDSP"
	Taskkill /f /im Dsp.dll            >Nul 2>&1
	Taskkill /f /im Fn.dll            >Nul 2>&1
	Goto :Eof
:Flush
	For /f "Tokens=1 Delims==" %%a in ('Set') Do (
	If /i "%%a" Neq "Comspec" (
	If /i "%%a" Neq "Tmp" (
	If /i "%%a" Neq "Userprofile" (
	IF /i "%%a" Neq "SystemRoot" (
	IF /i "%%a" Neq "Game" (
	IF /i "%%a" Neq "Gpu" (
	Set "%%a="))))))
	)
	Set "Path=%comspec:~0,-8%;%SystemRoot%;%Comspec:~0,-8%\Wbem"
	Goto :Eof

	:: -> Notes <- ::
	::C.Y = YellowCube   ::
	::C.G = GrayCube     ::
	::S.G = GreenSphere  ::
	::S.E = GraySphere   ::
	::S.R = RedSphere    ::
	::S.M = MagentaSphere::
	::T.B = BlueTriangle ::
	:: Charset For Frames: SRWUPYCVCMNLB;:." "
	:: -> Macros Area <- ::

:: -> Mouse <- :: V=%Y% W=%X% X=%M% Y=%K% Z=%C%
@2:Set M=0&Set KeyCode=&Set KeyChar=
@2:For /F "Tokens=1-4" %%W in ('!Fn! Inputhit !Accuracy!') Do (
@2:If %%W Equ KBD (
@2: Set "KeyCode=%%X"
@2: Set "KeyChar=%%Y"
@2:)
@2:
@2:If %%W Equ MOUSE (
@2: Set/a X=%%Y,Y=%%X,M=%%Z
@2:))

:: -> Effect <- ::
@3:For /F "Tokens=1" %%a in ("!Args!") Do (
@3: For /F "Tokens=1-2" %%b in ("!%%a!") Do (
@3: (Start "" /B Cmd /C "Core\Dsp.dll Core\Stream.arc -d trim %%b =%%c") >Nul 2>&1
@3:))

:: -> Tab <- ::
@4:For %%a in (
@4:"[36;01H[0;30m                                                  "
@4:"[1;36m"
@4:"[45;3H+-------+[45;36H+--------+[45;65H+------------+"
@4:"[46;3HÝ Mines Ý[46;36HÝ        Ý[46;65HÝ Ammunition Ý"
@4:"[47;3HÝ       Ý[47;30H+-----+--------+-----+[47;65HÝ            Ý"
@4:"[48;3HÝ       Ý[48;30HÝ                    Ý[48;65HÝ            Ý"
@4:"[49;3H+-------+[49;30H+--------------------+[49;65H+------------+"
@4:"[1;34m[47;7H!Mines![46;37H!Score![47;70H!Ammunition![48;5H!MineR!"
@4:"[48;67HÝÝÝÝÝÝÝÝÝÝ[1;3!StatusLive!m[48;31H!Lives_!"
@4:) Do <Nul Set/p=%%~a

:GenScoreList
	Del Core\Score.dat >Nul 2>&1
	set "Start="
	set "End="
	For /F "Tokens=1 Delims=:" %%a in ('Findstr /N /B "</*Score:Data>" "%Game%"') Do (
		If Not Defined Start (
			set Start=%%a
		) Else (
			Set End=%%a
		)
	)
	Set/a Count=!Start!
	For /F "Skip=%Start% Delims=" %%a in ('Type "%Game%"') do   (
		Set/a Count+=1
		If "!Count!" Geq "!End!" Goto :Eof
		%Dip%%%a>>Core\Score.dat
	)
	Goto :Eof

:: DON'T MODIFY THIS AREA!
<Score:Data>
®Ð¾¾Ð
'оÐÐ-ÐооОо¾
	ö	ü¯/¬:	ý	±	÷	ü¯<:	îÐÐоÐ		î	
ó	÷	÷	÷	÷«¯>:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	±®ÐÐоÐ		î	÷	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	î®ÐÐоÐ		±	ó	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	ý®ÐÐоÐ		±	÷	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	ó®ÐÐоÐ		Ã	ó	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	ô®ÐÐоÐ		Ã	÷	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	û®ÐÐоÐ		ö	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	ü®ÐÐоÐ		ü	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	ö®ÐÐоÐ		û	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	÷®ÐоÐ		ô	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	îÐоÐ		ó	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	±®ÐоÐ		ý	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	î®ÐоÐ		î	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	ý®ÐоÐ		±	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	ó®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	ô®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	û®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	ü®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	Ã	ö®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	±	÷®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	±	îÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	±	±®ÐоÐ		Ã	÷	÷	÷	÷«¯>:ÐÐÐÐÐÐ
žÐ¾ÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	±	î®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	±	ý®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯<
:	±	ó®ÐоÐ		Ã	÷	÷	÷	÷«¯>
:ÐÐÐÐÐОоÐО¾ÐЮ¯+
:ÐÐÐÐÐÐÐÐÐÐО¾Ð¾®¯®Ð¾¾Ð'оÐ
Ð-ÐооОо¾	ö	ü¯
</Score:Data>
Note: in the code, the '<Score:Data>' string is only a section for create a file with score data, this part contains
some data like score points, player name, position, message of player, but the code is obfuscated.

For make the file, this works with:

Code: Select all

<Nul Set/p=STRING
But have a limitation, only it can put 8KB or 8192 Characters (like enviroment variables)
and it can't put spaces or TAB at first of Set/p=

But, this is solved, all lines into '<Score:Data>' string contains a non space or tab char

Now, how works the '3D logos'?

Code: Select all

	For %%_ in (Circle Cube Triangle) Do (
	Set Count=0
	For /L %%a in (1,!SkipLoadFrame!,!Frames%%_!) do (
	Set/a Count+=1
	For /F "Delims=" %%b in ('Type !$Tmp!\%%_\[%%a]') Do (
		For %%z in (!Count!) Do Set "%%_[%%z]=!%%_[%%z]!%%~b"
	))
	Set/a Frames%%_=!Count!
	)
The For %%_ loop repeats for each figure, the load of frames for store in macros array for use in game
The data content of a frame is:

Code: Select all

...
[^^!X1^^!;^^!Y1^^!H MGGDGGDHYJRDMS
...
When the batch game is loaded, and load the macros and variables, code turns as:

Code: Select all

Circle[1]=[!X1;!Y1!HUUUPUTPRGFVF[!X1!;!Y2!HUJTFGODGFDGDF [...]
Now, for get a figure with 3D movement:

Code: Select all

Set/a X1=20,Y1=10,X1=20,Y2=11,...
For /L %%a in (1,1,NumberOfFrames) Do (
For %%T in ("!Circle[%%a]!") Do <Nul Set/p=%%~T
)
When 'X1' and 'Y1' are set, now in the macro have these values and place the figure through ANSI Escape Sequences,
and the result is:

Code: Select all

 ..:.;;;;.;:;
 :;;;;;..:::::;
 .........::::::;
.;:;.......;:::::
 .:;..........;;;
 .:;............;
 ;:;;;;;........;
 ;:;;;;;;.......;
 .:;;;;;;;.....;.
   .;;;;;;;;::::
     .;;;:::::;.
       .;::;.
Is very hard to explain how I did this! :?
Screenshots
Shoot_em_batch.png

Download

https://code.google.com/archive/p/shoot-em-batch/

My Youtube Channel: https://www.youtube.com/user/honguito98

Last edited by Honguito98 (19 Feb 2014 18:44)

.::{Honguito98}::.

----------------------------

#2 01 Feb 2014 03:26
dbenham

I've downloaded the game, and it appears to run with proper sound and spinning 3D intro screen. But I have no control over the game. The keyboard does nothing, and left mouse click on one of the buttons has no effect other than to freeze the screen until I press the Enter key. I've got Windows 7 Professional - 64 bit quad core. I'm at a loss :-/

You need to be careful with your attributions. jeb definitely made significant contributions to macro development, especially the modern syntax with arguments following the macro "call". But he did not invent them. DosTips user Ed Dyreen was the first to come up with a working batch macro that takes arguments. I picked up on the idea and started this thread - Batch "macros" with arguments, where Ed, jeb, and I collaborated to develop many of the key components to successful batch macros. That linked post has a link to Ed's originally posted macro (an ugly beast, but a major conceptual break through), as well as jeb's post where he developed the modern syntax.

Dave Benham

----------------------------

#3 01 Feb 2014 05:45
Honguito98
dbenham wrote:

I've downloaded the game, and it appears to run with proper sound and spinning 3D intro screen. But I have no control over the game. The keyboard does nothing, and left mouse click on one of the buttons has no effect other than to freeze the screen until I press the Enter key. I've got Windows 7 Professional - 64 bit quad core. I'm at a loss :-/

You need to be careful with your attributions. jeb definitely made significant contributions to macro development, especially the modern syntax with arguments following the macro "call". But he did not invent them. DosTips user Ed Dyreen was the first to come up with a working batch macro that takes arguments. I picked up on the idea and started this thread - Batch "macros" with arguments, where Ed, jeb, and I collaborated to develop many of the key components to successful batch macros. That linked post has a link to Ed's originally posted macro (an ugly beast, but a major conceptual break through), as well as jeb's post where he developed the modern syntax.

Dave Benham
Sorry for put incomplete credits, now are fixed.
About the game, has tried press left click and move the mouse over a button at once?, its a limitation of Batch.

.::{Honguito98}::.

----------------------------

#4 03 Feb 2014 13:46
dbenham

Credits much better, thanks.
I still cannot get the game to respond to a mouse click. I've tried a still mouse click over a button, a moving mouse click over a button, highlighting the entire button with mouse, etc. Nothing works :-(

Dave Benham

----------------------------

#5 03 Feb 2014 19:05
Honguito98

I updated the game, maybe can solve your problem, I modified Fn.dll (bg.exe), this makes that not clean the console input, up to exit.

https://code.google.com/archive/p/shoot ... /downloads

.::{Honguito98}::.

----------------------------

#6 16 Feb 2014 02:03
Honguito98

=== Update: 15/02/14 ===
*Now, Seta:DSP works on same process, making
that don't appears more windows and when the
game it's closed from [X], closes it Seta:DSP

* Enhanced Speed for Fn.dll (again)

* Bug Fix for "Move the mouse and get number
as name when you input your nickname and
message in Half Of Fame Screen"

* Bug Fixes for "bullets that not display correctly"

You can download it from above link

.::{Honguito98}::.

----------------------------

#7 17 Feb 2014 06:45
carlos

funny good game honguito.
The only bug to fix is disable the quick edit mode in the mouse routine, when cmd have quicke edit mode enable any clic select a cell, and none clic is getted.

----------------------------

#8 18 Feb 2014 01:36
dbenham

Thank you carlos for solving that mystery :)

For the life of me I could not figure out why the game would not work on my machine. Now I know.

Dave Benham

----------------------------

#9 18 Feb 2014 07:33
dbenham

OK, mouse problem solved, but now I have another problem.

I get the following error: "ERROR 1: ANSI Controller Load Failure"

The original download gave me that error for a while, and then mysteriously the error disappeared. But the last two downloads always give that error.

----------------------------

#10 18 Feb 2014 15:32
Honguito98

@dbenham
Try change the next line

Code: Select all

Core\Ansi.dll -l1 "%~0" LoadANSI 2>Nul
by this other

Code: Select all

Core\Ansi.dll "%~0" LoadANSI
If doesn't works, please tell me your error message.
(maybe that dll "programs", Windows does not detects it as executables therefore detects it as other file)

@carlos
I modified the source code, now work it, the error consist

Code: Select all

    new_mode =
	(DWORD) ((ENABLE_MOUSE_INPUT) & ~ENABLE_QUICK_EDIT_MODE
		 & ~ENABLE_PROCESSED_INPUT);
SetConsoleMode(screen.in, new_mode);

I deleted accidentaly a part of code (old_mode | ) , but this solves it

Code: Select all

    new_mode =
	(DWORD) ((old_mode | ENABLE_MOUSE_INPUT) & ~ENABLE_QUICK_EDIT_MODE
		 & ~ENABLE_PROCESSED_INPUT);
	SetConsoleMode(screen.in, new_mode);
But the major problem is when batch file calls to bg inputhit fucntion, sometimes quick edit mode activates and stop
the game, for solve this, I have to comment a line:

Code: Select all

	end:
	SetConsoleMode(screen.in, old_mode);
	FlushConsoleInputBuffer(screen.in);
by this

Code: Select all

	end:
	//SetConsoleMode(screen.in, old_mode);
	FlushConsoleInputBuffer(screen.in);
.::{Honguito98}::.

----------------------------

#11 18 Feb 2014 19:58
carlos

@honguito98: The msnd documentation says that enable extended flags is required for disable quick edit mode:

Edit: code modified.

maybe for improve the code this should work:

Code: Select all

new_mode =
	(DWORD) ( (old_mode | ENABLE_MOUSE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_EXTENDED_FLAGS)
		 & ~(ENABLE_QUICK_EDIT_MODE) );
	SetConsoleMode(screen.in, new_mode);
that are some code changes for the new version of bg (I'm working in a new sprite function) also other fix is sum 256 to the key code is if extended instead sum 255, but this changes require sum 1 to batch codes that checks for extended keys.

Last edited by carlos (18 Feb 2014 20:06)

----------------------------

#12 18 Feb 2014 20:21
Honguito98


@Carlos

Well, I have fix the code. My C programs and editions are very bad, I don't have experience about to program in C, I trying to learn making some tests, alike I did in Batch.

I can make a suggestion in your program?, well, when you develop bg.exe, make sure that functions be separately, ie, a function in each C file, this improves very much performance when batch file call to bg.exe.

Edit: Added comparision of 'TextColor.exe' created by Antonio.
Computer Specs: Windows 7 Ultimate x64, 4-core @ 2.10GHz, 2GB RAM

Some tests:

Code: Select all

TextColor.exe (written in assembler):
Time to generate all 255 colours: 1.45 sec.

bg.exe sprite (v2.8):
Time to generate all 255 colours: 2.84 sec.

bg.exe sprite (my version):
Time to generate all 255 colours: 1.64 sec.
Edit: programs in asm are very faster, but is bit hard to code it. In C, may be bit slow.

Note 1: my version of bg.exe, I modified each function in each file separately.
Note 2: I compiled with tcc.exe

Last edited by Honguito98 (19 Feb 2014 18:48)

.::{Honguito98}::.

----------------------------

#13 18 Feb 2014 21:12
carlos


thanks.
I always want the speed on bg.

----------------------------

#14 19 Feb 2014 18:17
Honguito98

I have done a tiny documentation of bg.exe:

Code: Select all

Bg.exe v2.8 - By Carlos
Copyright (c) 2010, 2011, 2012, 2013 Carlos. All rights reserved.

Revision 32 (Fn.dll) - By Honguito98
Enhanced with Seta:Core Developed By Honguito98

Help Menu:
   Syntax: Bg.exe [Function] [options]


   Functions:
   Mouse    -  Wait for a click and returns a number of key:
               Format: RowNumber ColNumber Key (0 80 2)
               eg: 1 = Left Click
               eg: 2 = Right Click
               eg: 4 = Midle Click

   Inputhit -  If a key is pressed or mouse is moved, returns on screen:
               Mouse:MOUSE Y X B
               Or
               KBD:AsciiCode Char.

   Kbd      -  Wait for a keystroke and returns the ascii code
               If an extended key was pressed, returns the second
               code plus 255, eg: Up Arrow = 72 + 255 = 327

   _Kbd     -  Same than Kbd, if any key is pressed, returns the
               ascii code, else return 0

   Time     -  Print eigth numbers separated by a space, that
               corresponds to the current:
               Year Month Day DayOfWeek Hour Minute Second Milliseconds

   Color    -  Set the current console font color. [Options] are:
               Bg.exe Color BgFg
               0 = Black   8 = Gray
               1 = Blue    9 = Light Blue
               2 = Green   A = Light Green
               3 = Aqua    B = Light Aqua
               4 = Red     C = Light Red
               5 = Purple  D = Light Purple
               6 = Yellow  E = Light Yellow
               7 = White   F = Bright White

   Cursor   -  Set size of cursor: [Bg.exe Cursor 1]
               0   = Hide
               1   = Show
               25  = Small
               50  = Medium
               100 = Large

   Sleep    -  Set time for sleep in milliseconds: [Bg.exe Sleep 1000]
   Locate   -  Locate the new position for cursor [Bg.exe Locate Row Col]
   Play     -  Play a wav file synchronously: [Bg.exe FileName.wav T]
               Where 'T' is number of times to repeat

   Print    -  Print text in color without new line to end. You
               can repeat arguments. Eg: Bg.exe Print 0a Hello_world\01
               Where \01 = ascii code for get a smiley face

   Font     -  Set the font size: [Bg.exe Font 6]
               Sizes of font: 0,1,2,3,4,5,6,7,8,9

   Sprite   -  Prints text in color using regular expressions:
               You can repeat arguments
               Bg.exe Sprite Row Col Cls Args
               Where:
               Row  = Y Coord (zero index based)
               Col  = X Coord (zero index based)
               Cls  = Colours (See Color Function)
               Args = Text with or without regular expressions
               * Note: regular expressions for chars need to be
                 in hexadecimal code: Eg 0a instead 10 (in dec)

   Maximize -  Maximize the console window
.::{Honguito98}::.

----------------------------

#15 19 Feb 2014 21:57
carlos

@honguito98: thanks for it.
I will separate the functions like you suggest.
I hope publish it in the next month in a site that I will create.

Currently I'm stopped in my develop of bg 2.9, I only need end the new function sprite (it would replace the current sprite function). It would use a method that would be more speed that any other function. Sure, but the development would be slow because my free time. And I will publish it with a demo game: the space invader (that I developed but it me show that current bg sprite is slow, but it would change).
But I have clear what that i need code.

you have some email for notify you when is done ?
you would help me writing the documentation?

Last edited by carlos (19 Feb 2014 22:03)

----------------------------

#16 20 Feb 2014 05:31
Honguito98

I understand. I spend you my email:

honguito DOT group AT gmail DOT com

Yes, I will write the documentation.

Also I have plans for release my game engines with your tool, (obviously giving credits), and some anothers commands for advanced music playback, etc.

.::{Honguito98}::.

----------------------------

#17 21 Feb 2014 03:30
carlos

Ok honguito98, thanks.
Post Reply