The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



  • Welcome to the new forums! Server IP: smp.hometownmc.com
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need help with a game I'm making
#1
So I am making a text based game with Windows batch coding. Here is the code so far:

@echo off 
title Game
color 02
echo Once upon a time a girl walked into a cave.
echo Upon entering she found a portal. Its surface was a deep purple, spirals all over its surface
pause
echo.
:enter/run
echo --------------------------------------------------------------------------------
echo [e] to enter the portal
echo [r] to run away
echo.
set /p enter/run=
cls
if %enter/run%==e (
echo Your character takes a breath, closes her eyes, and steps forward.
echo.
echo Your characters body feels as if its being ripped apart. 
echo.
echo Your character has lost consciousness.
pause
cls
goto jail
)

if %enter/run%==r (
echo Your character turns around and begins to run.
echo.
echo Your character feels a demon snatching at her feet.
echo.
echo Your character trips.
echo.
echo Your character has been dragged into the portal.
pause
cls
goto jail
)

if not %enter/run%==r (
echo ERROR
echo INVALID ASNWER
echo.
echo PLEASE TRY AGAIN
pause
cls
goto enter/run
)
:jail
cls
echo Your character wakes up bleary-eyed in a cell.
echo.
echo Your character peers around, trying to see in the semi-darkness.
pause
cls
:attack/go
echo Your character hears a small voice saying,
echo "Take this, use it to escape"
echo.
echo A small dagger drops into your character's lap.
echo.
echo Your character looks around for whoever has given you this weapon
pause
cls
echo A guard flings the door open and shouts,
echo "COME WITH ME"
pause
echo --------------------------------------------------------------------------------
echo [a] to attack the guard
echo [g] to go with the guard
echo.
set /p attack/go=
cls
if %attack/go%==a (
cls
color 0C
set /a enemyHP = 25
echo YOUR CHARACTER HAS ENTERED BATTLE!!!
echo. 
echo YOUR WEAPON IS A DAGGER.
echo.
echo YOUR CHARACTER HAS 100HP
echo.
echo YOUR ENEMY HAS %enemyHP%HP
pause
)

if %attack/go%==g (

)

if not %attack/go%==a (
echo ERROR
echo INVALID ASNWER
echo.
echo PLEASE TRY AGAIN
pause
cls
goto attack/go
)

As you may have noticed I have highlighted some parts. These are the parts I need help with. 
It's meant to say that the enemy has (however large the variable is)HP
Instead it says the enemy has HP

So, can anyone tell me how this works.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For anyone looking to run the game this what you do:
  1. Copy and paste the code into notepad
  2. Save the file on your desktop. 
  3. While saving it save it as Game.bat and have the file type set to 'all types'
  4. Finish saving it and double-click the file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please point out any bugs in the game.
I will update this thread from time to time with updates on the game.
 
Reply
  


Messages In This Thread
I need help with a game I'm making - by firegene - 03-29-2017, 02:06 AM

Forum Jump:


Browsing: 1 Guest(s)