DIR Return Create A Forum - Home
---------------------------------------------------------
techno game dev forum
HTML https://technogamedevforum.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Your Projects
*****************************************************
#Post#: 13--------------------------------------------------
my text adventure
By: axlyon Date: March 25, 2012, 3:11 pm
---------------------------------------------------------
i am currently trying to put together a text adventure. when i
start making progress i will post more here
#Post#: 22--------------------------------------------------
Re: my text adventure
By: OlDosLover Date: March 27, 2012, 12:35 am
---------------------------------------------------------
Hi all,
oki looking forward to it!
OlDosLover.
#Post#: 38--------------------------------------------------
Re: my text adventure
By: johnfree Date: April 29, 2012, 9:01 am
---------------------------------------------------------
Me too and we will help you if you tell us progress so far or
ideas so far
Harvey and John
#Post#: 48--------------------------------------------------
Re: my text adventure
By: OlDosLover Date: April 30, 2012, 9:25 am
---------------------------------------------------------
Hi all,
I have an old text book called "Teach Yourself Game
Programming in 21 Days" by Andre LM. It has a chapter on text
games. Would you like me to scan it and make available a zip
file of its contents Axlyon?
OlDosLover.
#Post#: 61--------------------------------------------------
Re: my text adventure
By: axlyon Date: April 30, 2012, 2:48 pm
---------------------------------------------------------
sure.... i can use all the help i can get
#Post#: 77--------------------------------------------------
Re: my text adventure
By: OlDosLover Date: May 1, 2012, 6:22 am
---------------------------------------------------------
Hi all,
Ok i'll get on to it and reply here.
OlDosLover.
#Post#: 84--------------------------------------------------
A text adventure. A fun variant with a few movie graphics
By: johnfree Date: May 4, 2012, 4:29 am
---------------------------------------------------------
Here is a little prog that is a word adventure with a little
graphics
It foretells the end of the world.
The nice thing is the words are so easily changed to whatever
you want!
So you can have fun there.
Also the only thing needed for the graphics is every heavenly
body accelerates as the mass of the nearby bodies divided by
distance squared.
So you can try other gravity rules if you like!
And it ends in a ginormous explosion (end of the world) which
you can design yourself!
This prog should be run on plain old QBAS
Run it on QB64 and you will need to slow it down enough to read
the comments. All good practice at seeing that you CAN change
what a prog does and how fast it does it.
Copy this into a prog that runs QBAS and hit run:
[code]CLS
SCREEN 12
DIM m$(40)
VIEW (0, 0)-(639, 479)
WINDOW (-5, -5)-(5, 5)
RANDOMIZE TIMER
FOR x = 1 TO 500
PSET (10 * RND - 5, 10 * RND - 5), 7
NEXT
PSET (0, 0), 14
i = 0: n = -1: iseen = 10000: da = 1: db = 1: dc = 1: colb = 2
REM orbits of heavenly bodies. Names are a, b, c, ..........
REM a has mass 10 and starts at x=0, y=0, vx=0, vy=0
ma = 10: xa = 0: ya = 0: vxa = 0: vya = 0
REM b has mass 1 and starts at x, y, with velocity vb
REM c has mass 3 and starts at xc, yc, with velocity vc
mb = 1: xb = -.55: yb = 0: vxb = 0: vyb = -4
mc = 3 - .00001: xc = -3.3065: yc = -6: vxc = -.532: vyc = -.12
vxa = -vxb / 10: vya = -vyb / 10
dabo = SQR((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb))
m$(1) = "Earth in orbit round sun"
m$(2) = "Green and Pleasant Land: 365 days a year: 65 deg F"
m$(20) = "Dawn of a new Ice Age?"
m$(21) = "Earth is an arid desert!"
m$(3) = "January 2017 ALERT: Earth orbit is shifting!"
m$(4) = "March 2017 Suspect massive comet is approaching"
m$(5) = "October 2017 Radio telescopes detect massive comet"
m$(6) = "December 2017 Government denies existence of comet"
m$(17) = "Wall Street Panic! "
m$(7) = "UK and US stock collapse: Many suicides"
m$(8) = "Sinners Repent: The End draws Nigh"
m$(9) = "Computations predict impact with Earth"
m$(11) = "Watch my lips: there is no comet (US President)"
m$(10) = " Comet visible in night sky"
m$(12) = "Comet visible in broad daylight"
m$(13) = " Comet turns night to day "
m$(14) = " Comet brighter than sun "
m$(15) = "Days this year "
m$(16) = "Mean day temp "
tnt = .00274
tint = tnt
WHILE INKEY$ = ""
i = i + 1
REM distance a from b:- dabsquared=dxsquared+dysquared
dxabsq = (xa - xb) * (xa - xb): dyabsq = (ya - yb) * (ya - yb)
dabsq = dxabsq + dyabsq
dab = SQR(dabsq)
REM acceleration of a due to b: (its really accn/dab)
fab = -1 / (dabsq * dab)
fxab = fab * (xa - xb)
fyab = fab * (ya - yb)
REM acceleration of b due to a:
fxba = -fxab * ma
fyba = -fyab * ma
REM acceleration of a due to c:
REM distance a from c:- dacsquared=dxsquared+dysquared
dxacsq = (xa - xc) * (xa - xc): dyacsq = (ya - yc) * (ya - yc)
dacsq = dxacsq + dyacsq
dac = SQR(dacsq)
REM acceleration of a due to c: (its really accn/dac)
fac = -mc / (dacsq * dac)
fxac = fac * (xa - xc)
fyac = fac * (ya - yc)
REM acceleration of c due to a:
fxca = -fxac * ma / mc
fyca = -fyac * ma / mc
REM acceleration of b due to c:
REM distance b from c:- dbcsquared=dxsquared+dysquared
dxbcsq = (xb - xc) * (xb - xc): dybcsq = (yb - yc) * (yb - yc)
dbcsq = dxbcsq + dybcsq
dbc = SQR(dbcsq)
REM acceleration of b due to c: (its really accn/dbc)
fbc = -mc / (dbcsq * dbc)
fxbc = fbc * (xb - xc)
fybc = fbc * (yb - yc)
REM acceleration of c due to b:
fxcb = -fxbc / mc
fycb = -fybc / mc
dvxa = (fxab + fxac) * tint
dvya = (fyab + fyac) * tint
dvxb = (fxbc + fxba) * tint
dvyb = (fybc + fyba) * tint
dvxc = (fxca + fxcb) * tint
dvyc = (fyca + fycb) * tint
vxa = vxa + dvxa
vya = vya + dvya
vxb = vxb + dvxb
vyb = vyb + dvyb
vxc = vxc + dvxc
vyc = vyc + dvyc
xa = xa + vxa * tint
ya = ya + vya * tint
xb = xb + vxb * tint
yb = yb + vyb * tint
xc = xc + vxc * tint
yc = yc + vyc * tint
PSET (xa, ya), 14
PSET (xb, yb), colb
PSET (xc, yc), 12
FOR iiy = 1 TO 300000: NEXT iiy' waste time
IF i > 3.5 * 184 THEN GOTO nxt
IF i < 3 THEN PRINT m$(i)
IF i = 1 * 184 THEN LOCATE 4, 1: PRINT m$(3)
IF i = 230 THEN PRINT m$(4)
IF i = 2 * 184 - 42 THEN PRINT m$(5)
IF i = 3 * 184 - 42 THEN PRINT m$(7)
IF i = 2 * 184 + 12 THEN PRINT m$(17)
IF i = 2 * 184 - 2 THEN PRINT m$(6)
IF i = 3 * 184 THEN PRINT m$(9)
IF i = 3 * 184 + 80 THEN PRINT m$(8)
nxt:
IF i = n * 184 THEN LOCATE 2, 27: PRINT m$(15); FIX(365 * dab /
dabo); : n = n + 1: GOSUB temp: LOCATE 2, 48: PRINT m$(16);
temp; " deg F"
IF da THEN IF dac < 6 THEN LOCATE 3, 1: PRINT m$(10): iseen = i:
da = 0
IF i = iseen + 6 THEN LOCATE 11, 1: PRINT m$(11)
IF dc THEN IF dac < 4 THEN PRINT m$(12): dc = 0: n = FIX(i /
184) + 1:
IF dc THEN IF dbc < dab THEN PRINT m$(14)
IF db THEN IF dbc < 2 THEN LOCATE 4, 1: PRINT m$(13): db = 0
IF dbc < .02 THEN LOCATE 10, 57: PRINT "comet imapacts earth":
GOTO earthend
IF dac < .07 THEN LOCATE 11, 57: PRINT "comet impacts sun":
GOSUB bang
IF i = 0 THEN LOCATE 1, 57: PRINT "Dawn of New Millenium?";
IF 1 = 2 * 184 THEN LOCATE 2, 57: PRINT "1 January 2017"
IF 1 = 5 * 184 THEN : LOCATE 3, 57: PRINT "End of the World?":
GOSUB blank
'IF i = 1 THEN PRINT m$(1)
'IF i = 1 THEN PRINT m$(1)
'IF i = 1 THEN PRINT m$(1)
' LOCATE 2, 60: PRINT 10 * (vxa ^ 2 + vya ^ 2) + vxb ^ 2 + vyb ^
2 + 3 * (vxc ^ 2 + vyc ^ 2)
WEND
SCREEN 0
STOP
temp:
temp = FIX(135 * dabo / dab - 70)
IF temp < 0 THEN colb = 3: LOCATE 2, 1: PRINT m$(20)
IF temp > 200 THEN colb = 6: LOCATE 2, 1: PRINT m$(21)
RETURN
blank:
LOCATE 4, 1
PRINT " "
PRINT " "
PRINT " "
PRINT " "
RETURN
bang:
FOR u = 1 TO 100 STEP .123
PSET (xa + .004 * u * COS(u), ya + .004 * u * SIN(u)), 15 - .1 *
u
NEXT
xc = xa: yc = ya + .1
vxa = -vxb * mb / (mc + ma): vya = -vyb * mb / (mc + ma)
dvc = (3.2 + .55 * RND) * SQR(ma): vxc = vxa - dvc: vyc = vya:
vxa = vxa + dvc * mc / ma
RETURN
earthend:
FOR u = 1 TO 2000 STEP .0455
PSET (xb + .004 * u * COS(u), yb + .004 * u * SIN(u)), 15 - .01
* u
NEXT
SUB blank
PRINT
PRINT
PRINT
PRINT
END SUB[/code]
[edit by axlyon. "was that so hard?"]
#Post#: 87--------------------------------------------------
Re: my text adventure
By: OlDosLover Date: May 7, 2012, 10:09 pm
---------------------------------------------------------
Hi all,
Interesting program John. I see this more as an added
commentary to an existing graphical program rather than true
text based game. Never the less i applaud you for you
contribution.
OlDosLover.
#Post#: 88--------------------------------------------------
Re: my text adventure
By: axlyon Date: May 7, 2012, 11:24 pm
---------------------------------------------------------
right now QB64's not working so i can't test any code. looks
good though. a few days ago, when i could test it, QB64 wanted
an "=" around here:
m$(4) = "March 2017 Suspect massive comet is approaching"
m$(5) = "October 2017 Radio telescopes detect massive comet"
m$(6) = "December 2017 Government denies existence of comet"
m$(17) = "Wall Street Panic! "
m$(7) = "UK and US stock collapse: Many suicides"
m$( = "Sinners Repent: The End draws Nigh"
m$(9) = "Computations predict impact with Earth"
can you guys test it so i can make sure i didn't copy the files
wrong when i put QB64 on my new PC?
#Post#: 89--------------------------------------------------
Re: my text adventure
By: OlDosLover Date: May 8, 2012, 8:04 am
---------------------------------------------------------
Hi all,
Im unable to run this. The problem is in the highlight copy
and paste action. This program needs to be put into a code box
and turn smileys off. The smileys (Chr$(8)) upset the ide
dreadfully.
OlDosLover.
*****************************************************
DIR Next Page