Here is a Pacman styled game in pure batch. Windows 10 or later.
Eat as many DOTS as you can before the CHASER gets you!
Use WASD to move around.
Cherries to turn into "The predator" where Pacman turns RED for the duration, and the CHASER becomes the CHASED.
Shields to increase how many times the CHASER can hit you.
PowerUps to increase your speed for a short duration.
Snowflakes - Freeze the Chaser in place
Poofs - Teleport the Chaser out of sight
Magnets - DOTS are magnetically drawn to you if you get close enough
Invisible - Makes you invisible to the Chaser
Teleport - Randomly teleports you and the Chaser
Periodically, the CHASER has a random chance to increase it's speed, so you will inevitably be caught, it's up to you how long that takes!
Pacman_Kinda.bat
https://github.com/IcarusLivesHF/Batch- ... _kinda.bat
Library.bat
https://github.com/IcarusLivesHF/Window ... ibrary.bat
Please enjoy
Pacman Kinda
Moderator: DosItHelp
-
- Expert
- Posts: 960
- Joined: 15 Jun 2012 13:16
- Location: Italy, Rome
Re: Pacman Kinda
very beatiful!!!
How did you make those drawings?
How did you make those drawings?
-
- Posts: 175
- Joined: 17 Jan 2016 23:55
Re: Pacman Kinda
Hi einstein! Thank you for asking, and your attention
In order to create these "sprites", I utilize VT100 escape sequences in windows 10.
Here is a few examples
Code: Select all
set "cherry=[2C[38;2;97;138;61m_[B[3D[C[38;2;159;100;66m/[B[3D[38;2;255;0;0m°[38;2;255;0;0mÛ[B[2D[38;2;255;0;0mÛÛ[A[D[0m"
set "shield=[38;5;12m'-'-'[B[5D[38;5;12m^|[38;5;7mÛSÛ[38;5;12m^|[B[5D[38;5;12m^|[38;5;7mÛÛÛ[38;5;12m^|[B[5D[38;5;12m\___/[3D[2A[0m"
set "powerUp=[38;5;9m[C/\[B[3D/[38;5;15m+1[38;5;9m\[B[4D`ÛÛ'[B[4D[CÛÛ[D[A[0m"
If you'd like to capture ESC yourself, you can use this
Code: Select all
for /f %%a in ('echo prompt $E^| cmd') do set "esc=%%a"
https://learn.microsoft.com/en-us/windo ... -sequences
In attempt to explain the best I can how I make my sprites, I use
Code: Select all
ESC[nC to shift the cursor RIGHT n spaces
ESC[nD to shift the cursor LEFT n spaces
ESC[nB to shift the cursor DOWN n spaces
ESC[nA to shift the cursor UP n spaces
ESC[38;2;R;G;Bm to COLOR the following character(s)
ESC[0m to turn off all attibutes so the sprite doesn't bleed into the environment with colors.
-
- Expert
- Posts: 960
- Joined: 15 Jun 2012 13:16
- Location: Italy, Rome
Re: Pacman Kinda
I assume that you use special fonts to draw in this way.
I can't find the part in question in the code.
Can you tell me?
I can't find the part in question in the code.
Can you tell me?
-
- Posts: 175
- Joined: 17 Jan 2016 23:55
Re: Pacman Kinda
No sir! No special fonts. My library from my github has installing fonts disabled as a default.
What I assume you mean is the ascii characters I used in ANSI encoding?
Lets closely observe this sprite (as I mentioned, dostips removes the ESC character from this line of code below so I will use %ESC% to show)
This is the VT100 sequence to draw a very ugly cherry lol. Following the logic I mentioned last time, C = RIGHT, B = DOWN, D = LEFT, A = UP
As you can see, I draw a special character after a COLORING sequence, for example
What I assume you mean is the ascii characters I used in ANSI encoding?
Lets closely observe this sprite (as I mentioned, dostips removes the ESC character from this line of code below so I will use %ESC% to show)
Code: Select all
set "cherry=[2C[38;2;97;138;61m_[B[3D[C[38;2;159;100;66m/[B[3D[38;2;255;0;0m°[38;2;255;0;0mÛ[B[2D[38;2;255;0;0mÛÛ[A[D[0m"
Code: Select all
set "cherry=
%esc%[2C
%esc%[38;2;97;138;61m_
%esc%[B
%esc%[3D
%esc%[C
%esc%[38;2;159;100;66m/
%esc%[B
%esc%[3D
%esc%[38;2;255;0;0m°
%esc%[38;2;255;0;0mÛ
%esc%[B
%esc%[2D
%esc%[38;2;255;0;0mÛÛ
%esc%[A
%esc%[D
[0m"
Code: Select all
%esc%[38;2;255;0;0mÛ
-
- Expert
- Posts: 960
- Joined: 15 Jun 2012 13:16
- Location: Italy, Rome
Re: Pacman Kinda
I swear I was convinced that they were pixels, your drawings are fantastic and so simple.
I like that kind of magnet that has the part in shadow and looks three-dimensional.
You can make very nice games.
I like that kind of magnet that has the part in shadow and looks three-dimensional.
You can make very nice games.
-
- Posts: 175
- Joined: 17 Jan 2016 23:55
Re: Pacman Kinda
It took me a little while to finally come up with ascii art that looked good. Thank you so much! I appreciate it