Qbasicnews.com
February 28, 2020, 06:33:09 PM
 Welcome, Guest. Please login or register. 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length
 Home Help Search Login Register
 Pages: 1 [2]
 Author Topic: ASCII Graphics Challenge! :P  (Read 11677 times)
*/-\*

Posts: 3655

 « Reply #15 on: January 09, 2004, 09:13:10 AM »

www.nodtveidt.net/useless_10b.zip

Just released: an updated version of the library, has much faster box routines and all the routines have been split into related modules. No new routines, but the manual comes in DOC HTML and TXT formats now, and there's a nifty (built in like 4 hours, so prolly buggy hehe) library builder included.
 Logged

I'd knock on wood, but my desk is particle board.
KiZ
__/--\__

Posts: 2879

 « Reply #16 on: January 09, 2004, 11:17:59 AM »

So with all this talk of libraries, is anyone actually writing a proggy?
 Logged
ravenxau
New Member

Posts: 9

 « Reply #17 on: March 31, 2004, 08:14:47 AM »

here is an ascii raycaster with texture mapping for anyone who wants to make a 3d game with it.

Cheers, Matt:)

Code:
'   Ascii Ray Caster with texture mapping
'   Using Integer Mathematics for speed    Clu 5-7-03      Qbasic 1.1
'
DEFINT A-Z: DIM l(16, 16), c(360), s(360), t(16, 16)
FOR y = 1 TO 16
FOR x = 1 TO 16
l(x, y) = VAL(MID\$(l\$, x, 1))
NEXT x
NEXT y
FOR y = 1 TO 16
FOR x = 1 TO 16
t(x - 1, y) = VAL(MID\$(l\$, x, 1))
NEXT x
NEXT y

FOR t = 0 TO 360
s(t) = 100 * SIN(22 / 7 * t / 180)
c(t) = 100 * COS(22 / 7 * t / 180)
NEXT t

x = 5600: y = 4000: f = 0: SCREEN 0: WIDTH 80, 50
DEF SEG = &HB800

main:
FOR s = -40 TO 39: a\$ = INKEY\$
r = f + (s * 60 \ 80): r = r + 360 * ((r > 360) - (r < 0))
r = r - (c(r) = 0): xi = c(r): yi = s(r): x1 = x: y1 = y:
wallcheck:
x1 = x1 + xi: y1 = y1 + yi
IF l(x1 \ 1600, y1 \ 1600) = 0 THEN GOTO wallcheck

xint = ABS(x1 - INT((x1 + 800) \ 1600) * 1600)
yint = ABS(y1 - INT((y1 + 800) \ 1600) * 1600)
IF xint > yint THEN tc = (x1 - (((x1 \ 1600)) * 1600)) \ 100
IF yint > xint THEN tc = (y1 - (((y1 \ 1600)) * 1600)) \ 100

d = (ABS((x - x1) \ c(r)) * c(ABS(r - f))) * .01
h = (69 * 16 \ d) \ 2
FOR ys = 0 TO 49
addr = (s + 40) * 2 + (ys * 160): POKE addr, 178
IF ys > 25 - h AND ys < 25 + h THEN POKE addr + 1, t(tc, INT(ys - (25 - h)) / (h * 2) * 16)
IF ys > 24 + h THEN POKE addr + 1, 2
IF ys <= 26 - h THEN POKE addr + 1, 9

NEXT ys
NEXT s

k = INP(96): f = f + 5 * (k = 75) - 5 * (k = 77)
f = f - 355 * (f = -5) + 360 * (f = 365)
dx = c(f) * (-(k = 72) + (k = 80)): dy = s(f) * (-(k = 72) + (k = 80))
IF l((x + dx) \ 1600, (y + dy) \ 1600) = 0 THEN x = x + dx: y = y + dy
IF INP(96) = 1 THEN SYSTEM ELSE GOTO main

DATA "1111111111111111"
DATA "1000010000010011"
DATA "1000000111110001"
DATA "1000010010000001"
DATA "1111111010000001"
DATA "1000001011101111"
DATA "1000001000000001"
DATA "1000000011100001"
DATA "1000001010000001"
DATA "1111111011100111"
DATA "1000001000000001"
DATA "1000101101001001"
DATA "1000000101011101"
DATA "1001000000001001"
DATA "1000000100000001"
DATA "1111111111111111"

DATA "8666666686666666"
DATA "8666666686666666"
DATA "8666666686666666"
DATA "8888888888888888"
DATA "6666866666668666"
DATA "6666866666668666"
DATA "6666866666668666"
DATA "8888888888888888"
DATA "8666666686666666"
DATA "8666666686666666"
DATA "8666666686666666"
DATA "8888888888888888"
DATA "6666866666668666"
DATA "6666866666668666"
DATA "6666866666668666"
DATA "8888888888888888"
 Logged
Spotted Cheetah
Ancient QBer

Posts: 400

 « Reply #18 on: April 02, 2004, 08:01:47 PM »

Plasma357 wrote on a topic some months ago:

Quote

Code:
junk = INP(&H3DA)             'disable text blinking
OUT &H3C0, &H20 + &H10        'and enable all the background colors
OldAttr = INP(&H3C1)
OUT &H3C0, OldAttr AND &HF7
junk = INP(&H3DA)

To change a character on the screen:
Code:
POKE (Row - 1) * NumCols * 2 + (Col - 1) * 2, Char

To change a color on the screen:
Code:
POKE (Row - 1) * NumCols * 2 + (Col - 1) * 2 + 1, Colr

Where NumCols is the number of columns active (80 or 40).

This should be useful here, not?

(I found these words at DEF SEG = &HB800, at 29th Octobre, 2003)

I have not got anything to show up here now, but I am interested in this subject. I will do something as soon as I will have time
 Logged

fter 60 million years a civilization will search for a meteorite destroying most of the living creatures around this age...

There must be a better future for the Cheetahs!

http://rcs.fateback.com/
Pc72
Forum Regular

Posts: 101

 « Reply #19 on: April 04, 2004, 05:46:31 PM »

If you want ASCII graphics, I'll give you ASCII graphics!!! The first thing you do is go to my old page, http://pc72.narod.ru/old/ and download REFORM.  REFORM is a VGA font editor, which you can use to make fonts for use in text mode.

I've developed it a year ago, but it's still good.  Let's see what you think

With REFORM you can do all the ASCII graphics you want.
 Logged

Rhiannon
Been there, done that

Posts: 1031

 « Reply #20 on: April 04, 2004, 08:07:11 PM »

adosorken was thinking about something like that earlier, he'll check it out later
 Logged

igitalblackie.com - Done! Ask about our hosting

-Goddess of the of the No More Religion Threads movement
speedlemon
I hold this place together

Posts: 874

 « Reply #21 on: April 04, 2004, 09:20:01 PM »

ravenxao- all i can say is WOW! elegant gem
 Logged
Spotted Cheetah
Ancient QBer

Posts: 400

 « Reply #22 on: April 05, 2004, 01:37:09 PM »

Pc72:

I would like to get your program, but i could not download it! I am using netscape 7, and MsIE does not work very well...

I think you should create something what works under Netscape too. This is the only way to put out Bill Gates  :wink:
 Logged

fter 60 million years a civilization will search for a meteorite destroying most of the living creatures around this age...

There must be a better future for the Cheetahs!

http://rcs.fateback.com/
*/-\*

Posts: 3655

 « Reply #23 on: April 10, 2004, 11:02:41 PM »

Quote from: "Spotted Cheetah"
I think you should create something what works under Netscape too. This is the only way to put out Bill Gates  :wink:

:roll:  :roll:  :roll:  :roll:  :roll:  :roll:
Pulease, get off the "I hate Bill Gates" bandwagon...it's such an overused cliché...

Anyways...glad to see some people are still interested in textmode stuff
 Logged

I'd knock on wood, but my desk is particle board.
Spotted Cheetah
Ancient QBer

Posts: 400

 « Reply #24 on: April 12, 2004, 08:47:48 PM »

I not hate Bill Gates, i only hate that everything other is diing. And when some homepage creators make homepages only for MSIE - and what if someone uses a Linux - only system? Then what to do? Make them blind, or try creating something what works on their browser too. I would do the last... I think everybody should make his or her homepage to work with at least these two browsers: MSIE, and Netscape (or Mozilla).

Anyways thanks for welcoming here (Instead of firing off this another Gates - killer)
 Logged

fter 60 million years a civilization will search for a meteorite destroying most of the living creatures around this age...

There must be a better future for the Cheetahs!

http://rcs.fateback.com/
 Pages: 1 [2]