The QBasic Forum

The QBasic Forum: QBasic Help, QuickBasic Help, QBasic Programming
QB FAQ          Homework Help          Subforums, Links and Downloads, Chat Room


getting sprite to move with inkey$

by yourface

Can someone help me get my sprite to move with inkey$. Here is what I have and it's probably totally wrong. Any help would be appreciated.

'*** Draws sprite ***
LINE (1, 1)-(50, 10), 15, B
LINE (2, 2)-(49, 9), 1, B
LINE (3, 3)-(48, 8), 15, B
LINE (4, 4)-(47, 7), 1, B
PAINT (5, 5), 2, 1

'*** saves sprite in an array ***
DIM block%(500)
GET (1, 1)-(50, 10), block%

CLS

'*** Puts block sprite in position and moves it ***

DO
LET x = 5
PUT (x, 180), block%
m$ = INKEY$
IF m$ = "6" THEN
LET x = x + 1
ELSEIF m$ = "4" THEN
LET x = x - 1
ELSEIF m$ = CHR$(27) THEN
END
END IF

Posted on May 9, 2008, 6:07 AM
from IP address 208.108.221.87

Respond to this message   

Goto Forum Home


Here's one (of many) possible solutions...

by Galleon

SCREEN 13

LINE (1, 1)-(50, 10), 15, B
LINE (2, 2)-(49, 9), 1, B
LINE (3, 3)-(48, 8), 15, B
LINE (4, 4)-(47, 7), 1, B
PAINT (5, 5), 2, 1

DIM block%(500)
GET (1, 1)-(50, 10), block%

CLS

x = 5

DO

'if sprite has moved, erase its old location and draw it again
IF x <> lastx THEN
LINE (lastx, 180)-(lastx + 49, 180 + 9), 0, BF
PUT (x, 180), block%, PSET
lastx = x
END IF

'input
m$ = INKEY$
IF m$ = "6" THEN x = x + 1
IF m$ = "4" THEN x = x - 1
IF m$ = CHR$(27) THEN END

LOOP

Posted on May 9, 2008, 6:20 AM
from IP address 122.104.46.15

Respond to this message   

Goto Forum Home


(URL)Have you guys ever heard of DARKBASIC? It seems kindof cool..

by drew

http://darkbasic.thegamecreators.com/

I have google videoed some of the games that have been made in that language, it seems kind of nice.

It's just another BASIC language, just to make more 3D, modern games, and such.


(Although my graphics screen still gives me errors so I can't play around with it =[ )

Post some likes / dislikes, reviews.. Just saw it on google.



drew

Posted on May 8, 2008, 7:14 PM
from IP address 98.26.104.159

Respond to this message   

Goto Forum Home


Yes I have

by

I have seen it, I even have it but it is a trial version so it has a time and it has alredy run out.

Posted on May 8, 2008, 7:31 PM
from IP address 220.245.178.132

Respond to this message   

Goto Forum Home


This main forum is strictly for QBasic.

by Solitaire

Yes, we regulars have all heard about alternate versions of BASIC. It's nothing new.

If you wish to discuss other versions of BASIC, then please take it to the Non-QBasic subforum.



    
This message has been edited by Solitaire1 from IP address 74.73.58.57 on May 8, 2008 7:36 PM

Posted on May 8, 2008, 7:36 PM
from IP address 74.73.58.57

Respond to this message   

Goto Forum Home


how do you use DIR$?

by

This question is quiet simple. How do you use DIR$

File$ = "C:\"
PRINT DIR$(file$)

This works but it only displays one file. How do you make it disply more, or can't you.

Posted on May 7, 2008, 7:36 PM
from IP address 220.245.178.133

Respond to this message   

Goto Forum Home


It's in the help file

by qbguy

"Usage Notes
* DIR$ returns the first filename that matches the filespec$ you
specify. To retrieve additional filenames that match the filespec$
pattern, call DIR$ again with no argument. When no filenames match,
DIR$ returns a null string."

Posted on May 7, 2008, 7:49 PM
from IP address 75.9.211.189

Respond to this message   

Goto Forum Home


Need more sprites

by

I am making a game and I need more sprites.
The sprites need to be 32,32 and in numbers
If you want to use the blank sprite in the zip to make up your own you can. (REMEMBER: the number 5 is invisible)
I need people, grass, dirt, snow, and plenty other things (including monsters)
Please send them to my email address at coolnotsocool@live.com.au

the numbers are like this (only 32 by 32)

5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5

Posted on May 7, 2008, 6:13 PM
from IP address 220.245.178.133

Respond to this message   

Goto Forum Home


*Consider rephrasing your **request**, and throw in some motivation to fulfill it.

by

*

Posted on May 7, 2008, 6:37 PM
from IP address 71.102.246.240

Respond to this message   

Goto Forum Home


OK here

by qbguy

SPRITE


SPRITE WITH PEOPLE

Posted on May 7, 2008, 6:37 PM
from IP address 75.9.211.189

Respond to this message   

Goto Forum Home


*You're lucky I'm a believer in open source, otherwise I'd say you STOLE my idea!

by

Posted on May 8, 2008, 1:16 AM
from IP address 220.245.178.133

Respond to this message   

Goto Forum Home


Need more sprites (updated)

by

I am making a game and I need more sprites because I am no good at drawing them.
The sprites need to be 32,32 and in numbers. (see the example)
Each number is a colour so 1 = blue so on.
(REMEMBER: the number 5 is invisible)

I need people, grass, dirt, snow, and plenty other things (including monsters)
Please send them to my email address at coolnotsocool@live.com.au
I have the ALPHA vesion of the game (with bad graphics) If you want it please email me for it. It also has some xamples.
the numbers are like this (only 32 by 32)

5,5,5,5,5,5,5,1,5,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,5,1,5,1,5,5,5,5,5,5,5,5,5,5,5
5,5,5,5,5,1,5,5,5,1,5,5,5,5,5,5,5,5,5,5
5,5,5,5,1,5,5,5,5,5,1,5,5,5,5,5,5,5,5,5
5,5,5,1,5,5,5,5,5,5,5,1,5,5,5,5,5,5,5,5
5,5,1,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
1,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5
5,1,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5

Don't ask we what this is.

Posted on May 7, 2008, 7:12 PM
from IP address 220.245.178.133

Respond to this message   

Goto Forum Home


you totally missed the point *smacks forehead*

by

This is your project, not ours. If you want someone on this forum to make some sprites for you you need to ask. What you did was inform us that we'll be making sprites in format x and giving them to you through method y. Don't get me wrong, I won't be making any either way, but I find it unlikely that you'll get what you want from others if you act that way.

I've actually done this before, come to the forum and asked for some sprites for a game. (Sorry TheBOB, no I still haven't finished it, though I do still remember it and want to finish it,,, someday.) I got several, but (while I can't find my post) I'm pretty sure I was polite in asking, and I think I even made them myself and simply asked how to make them better (to which I was just given much better ones).

PhyloGenesis

Posted on May 7, 2008, 11:07 PM
from IP address 71.102.246.240

Respond to this message   

Goto Forum Home


Generally, we love coding not drawing. Here's a link to heaps of tile graphics (*URL)

by Galleon

http://www.videogamesprites.net/Links/

Posted on May 8, 2008, 2:07 AM
from IP address 122.104.46.15

Respond to this message   

Goto Forum Home


...now that you've chosen your graphics, we'd love to help you!

by Galleon

You'll need a simple image editing program which can handle .bmp graphics and palettes.

1. Resize/clip your images until they are 32x32

2. Apply the 256 colour qbasic/system palette to them (assuming you are working in screen 13).

3. Save the image as a 256 color RGB encoded (not RLE encoded!!!) .bmp file.

4. The .bmp file can be loaded and used in your QBASIC program. (You'll probably need to use an existing .bas bmp loader or ask for some help, but I assure you for a 32x32 system palette'd image it is a VERY simple process)

The qbasic/system palette is as follows (in RGB form from index 0 to 255):
0 0 0
0 0 168
0 168 0
0 168 168
168 0 0
168 0 168
168 84 0
168 168 168
84 84 84
84 84 252
84 252 84
84 252 252
252 84 84
252 84 252
252 252 84
252 252 252
0 0 0
20 20 20
32 32 32
44 44 44
56 56 56
68 68 68
80 80 80
96 96 96
112 112 112
128 128 128
144 144 144
160 160 160
180 180 180
200 200 200
224 224 224
252 252 252
0 0 252
64 0 252
124 0 252
188 0 252
252 0 252
252 0 188
252 0 124
252 0 64
252 0 0
252 64 0
252 124 0
252 188 0
252 252 0
188 252 0
124 252 0
64 252 0
0 252 0
0 252 64
0 252 124
0 252 188
0 252 252
0 188 252
0 124 252
0 64 252
124 124 252
156 124 252
188 124 252
220 124 252
252 124 252
252 124 220
252 124 188
252 124 156
252 124 124
252 156 124
252 188 124
252 220 124
252 252 124
220 252 124
188 252 124
156 252 124
124 252 124
124 252 156
124 252 188
124 252 220
124 252 252
124 220 252
124 188 252
124 156 252
180 180 252
196 180 252
216 180 252
232 180 252
252 180 252
252 180 232
252 180 216
252 180 196
252 180 180
252 196 180
252 216 180
252 232 180
252 252 180
232 252 180
216 252 180
196 252 180
180 252 180
180 252 196
180 252 216
180 252 232
180 252 252
180 232 252
180 216 252
180 196 252
0 0 112
28 0 112
56 0 112
84 0 112
112 0 112
112 0 84
112 0 56
112 0 28
112 0 0
112 28 0
112 56 0
112 84 0
112 112 0
84 112 0
56 112 0
28 112 0
0 112 0
0 112 28
0 112 56
0 112 84
0 112 112
0 84 112
0 56 112
0 28 112
56 56 112
68 56 112
84 56 112
96 56 112
112 56 112
112 56 96
112 56 84
112 56 68
112 56 56
112 68 56
112 84 56
112 96 56
112 112 56
96 112 56
84 112 56
68 112 56
56 112 56
56 112 68
56 112 84
56 112 96
56 112 112
56 96 112
56 84 112
56 68 112
80 80 112
88 80 112
96 80 112
104 80 112
112 80 112
112 80 104
112 80 96
112 80 88
112 80 80
112 88 80
112 96 80
112 104 80
112 112 80
104 112 80
96 112 80
88 112 80
80 112 80
80 112 88
80 112 96
80 112 104
80 112 112
80 104 112
80 96 112
80 88 112
0 0 64
16 0 64
32 0 64
48 0 64
64 0 64
64 0 48
64 0 32
64 0 16
64 0 0
64 16 0
64 32 0
64 48 0
64 64 0
48 64 0
32 64 0
16 64 0
0 64 0
0 64 16
0 64 32
0 64 48
0 64 64
0 48 64
0 32 64
0 16 64
32 32 64
40 32 64
48 32 64
56 32 64
64 32 64
64 32 56
64 32 48
64 32 40
64 32 32
64 40 32
64 48 32
64 56 32
64 64 32
56 64 32
48 64 32
40 64 32
32 64 32
32 64 40
32 64 48
32 64 56
32 64 64
32 56 64
32 48 64
32 40 64
44 44 64
48 44 64
52 44 64
60 44 64
64 44 64
64 44 60
64 44 52
64 44 48
64 44 44
64 48 44
64 52 44
64 60 44
64 64 44
60 64 44
52 64 44
48 64 44
44 64 44
44 64 48
44 64 52
44 64 60
44 64 64
44 60 64
44 52 64
44 48 64
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

Posted on May 8, 2008, 2:27 AM
from IP address 122.104.46.15

Respond to this message   

Goto Forum Home


a = a + a$?

by

I asked the question before how you can do a$ = a$ + a and I got an answer so now I am asking the question

can you do a = a + a$ and how do you do it.
I need something like this:

num = 10
PRINT "WELCOME TO THE NUMBER"
INPUT "WHAT NUMBER WOULD YOU LIKE"; num$
num = num + num$ 'Here is the coding that I need
PRINT "10 + "; num$; " = "; num

I know that you can do INPUT num instead of num$ but I want to know if you can invert num$ into num

Posted on May 7, 2008, 6:07 PM
from IP address 220.245.178.133

Respond to this message   

Goto Forum Home


Yes, use VAL

by qbguy

num = 10
PRINT "WELCOME TO THE NUMBER"
INPUT "WHAT NUMBER WOULD YOU LIKE"; num$
num = num + VAL(num$)
PRINT "10 + "; num$; " = "; num

Posted on May 7, 2008, 6:34 PM
from IP address 75.9.211.189

Respond to this message   

Goto Forum Home


*Darnit! I was logged out of n54 and you answered while I was logging in.

by

*

Posted on May 7, 2008, 6:36 PM
from IP address 71.102.246.240

Respond to this message   

Goto Forum Home


*There certainly is a way, namely VAL(a$).

by

*

Posted on May 7, 2008, 6:35 PM
from IP address 71.102.246.240

Respond to this message   

Goto Forum Home


*Using a string with INPUT also avoids a Redo from Start error

by

Posted on May 8, 2008, 7:40 AM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


Trying to convert binary file to ASCII

by trader

I have some files from an old stock charting program that I want to use on a newer Linux program. The data is stored in BINARY format. Each record in the file represents one price bar and contains the date, open, high, low, and closing prices as well as the trading volume and open-interest for each bar's time frame (intraday, daily, weekly, etc.)

Each bar on a chart is stored in the file as one record, 28 bytes in length. I'm trying to convert these type of BINARY files to ASCII. This is what I've written, but when I run the program on QBASIC 1.1 I have the following error message:

"Subscript out of range

An array element was referred to with a subscript that was outside the dimensions of the array, or an element of an undimensioned dynamic array was accessed. Check that the array is dimensioned and check the bounds of the array. You may also get this error if the array size exceeds 64K. Reduce the size of the array. Err code 9"

The file "SP.D" I'm trying to convert is less than 64K. The debugger points to the line:

DIM R(0 TO 2350) AS BAR 'Assumes < 2350 bars in file



Can anyone see where the problem is?? Thanks, much appreciated!!


'NOTE: Reads a data file, prints the contents of the
' file to the screen, then saves the data to an
' ASCII text file.
'
TYPE BAR
D AS LONG '4 byte DATE
O AS SINGLE '4 byte OPEN
H AS SINGLE '4 byte HIGH
L AS SINGLE '4 byte LOW
C AS SINGLE '4 byte CLOSE
V AS LONG '4 byte VOLUME
I AS LONG '4 byte OPEN INTEREST or CLOCK TIME
END TYPE
DIM R(0 TO 2350) AS BAR 'Assumes < 2350 bars in file
'
'Read file
'
FILENAME$ = "SP.D"
OPEN FILENAME$ FOR RANDOM AS #1 LEN = 28
LastRecord% = LOF(1) / 28
FOR I% = 1 TO LastRecord%
GET #1, I%, R(I%)
PRINT R(I%).D; " "; R(I%).O; " "; R(I%).H; " "; R(I%).L;
PRINT R(I%).C; " "; R(I%).V; " "; R(I%).I
NEXT I%
CLOSE #1
'
'Output as ASCII file
'
OPEN SP.ASC FOR OUTPUT AS #1
FOR I% = 1 TO LastRecord%
WRITE #1, R(I%).D, R(I%).O, R(I%).H, R(I%).L, R(I%).C, R(I%).V, R(I%).I
NEXT I%
CLOSE #1


Posted on May 7, 2008, 1:39 PM
from IP address 96.227.120.156

Respond to this message   

Goto Forum Home


Use PUT #2 and a RANDOM file instead of opening for OUTPUT

by

R contains all of the data as the TYPE definition. So you don't need to load each TYPE

Ted



    
This message has been edited by burger2227 from IP address 71.60.226.47 on May 7, 2008 3:02 PM

Posted on May 7, 2008, 2:54 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


Your array is too big; try this

by

'NOTE: Reads a data file, prints the contents of the
' file to the screen, then saves the data to an
' ASCII text file.
'
TYPE BAR
D AS LONG '4 byte DATE
O AS SINGLE '4 byte OPEN
H AS SINGLE '4 byte HIGH
L AS SINGLE '4 byte LOW
C AS SINGLE '4 byte CLOSE
V AS LONG '4 byte VOLUME
I AS LONG '4 byte OPEN INTEREST or CLOCK TIME
END TYPE

DIM Rec AS BAR

'
'Read file
'

OPEN "SP.D" FOR RANDOM AS #1 LEN = 28
OPEN "SP.ASC" FOR OUTPUT AS #2
LastRecord% = LOF(1) \ 28 'Discards any fractional records
FOR I% = 1 TO LastRecord%
GET #1, I%, Rec
PRINT Rec.D; " "; Rec.O; " "; Rec.H; " "; Rec.L;
PRINT Rec.C; " "; Rec.V; " "; Rec.I
WRITE #2, Rec.D, Rec.O, Rec.H, Rec.L, Rec.C, Rec.V, Rec.I
NEXT I%
CLOSE 'closes all files



    
This message has been edited by Mikrondel from IP address 220.245.178.133 on May 7, 2008 4:24 PM

Posted on May 7, 2008, 4:24 PM
from IP address 220.245.178.133

Respond to this message   

Goto Forum Home


*Works great!!

by trader

:-)

Posted on May 8, 2008, 4:53 PM
from IP address 71.185.153.195

Respond to this message   

Goto Forum Home


Simple 3D program

by

http://www.network54.com/Forum/190883/message/1209988526/3D+object

I'm just playing with the whole rotation matrices thing. It's a quick-and-dirty little program, but I thought some of you might be interested.

Posted on May 5, 2008, 4:58 AM
from IP address 220.245.178.132

Respond to this message   

Goto Forum Home


*Ran program, got a blank screen. Help!

by Ralph

*

Posted on May 5, 2008, 7:52 PM
from IP address 66.170.223.178

Respond to this message   

Goto Forum Home


*Do other SCREEN 13 programs work for you?

by

Posted on May 6, 2008, 4:49 AM
from IP address 220.245.178.132

Respond to this message   

Goto Forum Home


* Nothing works for Ralph! LOL

by

Posted on May 6, 2008, 12:03 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


Yes, all other SCREEN 13 programs do work for me.

by Ralph

And, when one doesn't, I usually get an error message that I can solve. In this case, nada!

Hey, Ted, good tease, but, no cigar, 'cause you made me laughm ha, ha!

Posted on May 7, 2008, 8:27 PM
from IP address 66.170.223.178

Respond to this message   

Goto Forum Home


*Comment out the PAINT and see if you get an outline

by

Posted on May 8, 2008, 1:21 AM
from IP address 220.245.178.133

Respond to this message   

Goto Forum Home


Solitaire - clean up on isle 5?

by Pete

I saw this in the index and I'm not sure which page it is on:

http://www.network54.com/Forum/13959/message/1209952798/IDNLdXKorZ

Spammers do this to build link recognition on search engines. If you can and would like to delete it, please do so. Thanks for your past efforts in this area, which I suspect go a bit unnoticed because of the great job you have done of zapping such posts.

Pete

 

Posted on May 4, 2008, 7:32 PM
from IP address 70.177.5.114

Respond to this message   

Goto Forum Home


*Hear, hear -- but seriously, where's Mac?

by

*

Posted on May 4, 2008, 7:59 PM
from IP address 74.15.66.121

Respond to this message   

Goto Forum Home


GOODquestion, but Pete and Solitaire have no email addresses!

by

The TWO people that should know are not saying anything, but they come here to post like any other anonymous person because neither use an email address!

You wanna piece of me? My address is free to mess with! People that toss away crap just cover their own freaking asses! As BIG an ass that I can be sometimes, I have ended up making more friends than enemies. People usually respect honesty!

I EXPECT a Freaking answer SOON!  MAC has a lot of balls and so do I! I miss him......I hope he is OK!

Ted

 



    
This message has been edited by burger2227 from IP address 71.60.226.47 on May 6, 2008 8:17 PM

Posted on May 6, 2008, 8:09 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


* I sent Mac an email 2 or 3 days ago but have not received a response.

by Solitaire

Posted on May 7, 2008, 11:14 AM
from IP address 67.90.218.94

Respond to this message   

Goto Forum Home


Spam deleted. I do hope Mac is OK.

by Solitaire

I've had a series of personal problems and was unable to check the computer more than once for a few minutes yesterday.

The first problem arose several days ago when my desktop computer died. My son temporarily brought up a flaky computer from the basement to use. It has only the basic OS and Office installed, but not the rest of my software. It also has a nasty habit of shutting down every few minutes so it's just not reliable. My son ordered parts to build a new computer from scratch, but that will take awhile to complete.

My laptop also has a problem. The BIOS battery died and I have to keep reconfiguring it every time I turn it on.

Other more serious family health problems came up, which I won't go into now.

My son lost his wallet with all his ID cards in a movie theater day before yesterday. Our car is about to die and needs to be replaced. He drove it out to Long Island and got stuck there at a friend's house when it wouldn't start. He called me at 4:30 AM this morning to get the number of AAA. I just emailed him a copy of the registration, which he didn't have on him.

I have to get to school in a couple of hours, and I have a doctor's appointment after that.

I'll try to email Mac to see if he replies. If he's on vacation, he may not have access to a computer.



    
This message has been edited by Solitaire1 from IP address 74.73.58.57 on May 5, 2008 5:53 AM

Posted on May 5, 2008, 5:51 AM
from IP address 74.73.58.57

Respond to this message   

Goto Forum Home


* You would think that he would have told somebody........

by

Posted on May 5, 2008, 8:15 AM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


I can not think that he would knowingly leave without letting someone know

by roy

Which would seem to imply that he is ill. Pete did mention a vacation just after Mac vanished but I don't know what made him say that.

Posted on May 5, 2008, 9:25 AM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


Refering to my menu seen below

by New Guy

Ok the menu I have in the below forum I am trying to make the blood on the letter L fall downwards(eventually it will loop and fall into a pool of blood!. I was able to acheive this by using(FOR row = 94 155)Then putting row in the position of the PUT blood statment. I then tried to WAIT it so it could be seen. However it went to fast and wheneve I tried to take the number 8 in my Wait statement to a lower number the screen froze. Can someone help with this!

Posted on May 2, 2008, 11:12 AM
from IP address 208.108.221.87

Respond to this message   

Goto Forum Home


The 8 in the WAIT statement does not refer to duration...

by

It is a value that must be retrieved from the &H3DA port to indicate a condition of screen refresh -- in other words, don't mess with it!

If you want to create a longer delay, just multiply the number of times you WAIT:

FOR Reps = 1 TO 5 '<---adjust up or down until speed is correct
WAIT &H3DA, 8: WAIT &H3DA, 8, 8
NEXT Reps

-Bob

Posted on May 2, 2008, 11:38 AM
from IP address 70.52.180.222

Respond to this message   

Goto Forum Home


*Use the TIMER command, but remember it is only accurate to 1/18th of a second.

by

Posted on May 3, 2008, 3:57 AM
from IP address 58.106.166.35

Respond to this message   

Goto Forum Home


Timer delays go something like this...

by Pete

SPEED% = 2: REM Where 1 / SPEED% controls the seconds of the delay.
Z1 = TIMER
DO
IF Z1 > TIMER THEN Z1 = Z1 - 86400: REM Adjust for midnight.
IF TIMER - Z1 > 1 / SPEED% THEN EXIT DO
LOOP

Posted on May 3, 2008, 8:47 AM
from IP address 70.177.5.114

Respond to this message   

Goto Forum Home


* You mean "referring". Even the HTTP spec gets it wrong.

by Speeling Police

Posted on May 3, 2008, 7:34 PM
from IP address 75.9.211.189

Respond to this message   

Goto Forum Home


Ok How do I fix this. I got confused by what you guys said

by New Guy

The blood is dropping but its dropping with a trail and the screen goes blank untill it finishes dropping, how can i fix this?



DECLARE SUB welcome (Print$)
DECLARE SUB background (line$)
DECLARE SUB bloodinvaders (Print$)
'*** Space invaders! ****
'**** Justin Singleton, Grogan
DEFINT A-Z
SCREEN 7
CLS

'**BLOOD**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,04,00,00,00,00
DATA 00,00,00,04,04,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ blood
PSET (x, y), blood
NEXT x
NEXT y

DIM blood%(90)
GET (0, 0)-(9, 10), blood%






'**NEEDLE**
DATA 00,00,00,00,00,00,00,00,15
DATA 00,00,00,00,15,00,15,15,00
DATA 00,00,00,00,00,15,04,15,00
DATA 00,00,00,00,15,04,15,00,00
DATA 00,15,00,15,04,15,00,15,00
DATA 00,00,15,04,15,00,00,00,00
DATA 00,00,04,15,00,00,00,00,00
DATA 00,04,00,00,15,00,00,00,00
DATA 04,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ needle
PSET (x, y), needle
NEXT x
NEXT y

DIM needle%(90)
GET (0, 0)-(9, 10), needle%


'**CROSS**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,04,15,15,04,15,15,04,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ cross
PSET (x, y), cross
NEXT x
NEXT y

DIM cross%(90)
GET (0, 0)-(9, 10), cross%


CLS
PUT (166, 102), needle
PUT (95, 86), cross
PUT (192, 86), cross
PUT (82, 110), cross
PUT (221, 110), cross
PUT (132, 94), blood
'***Making the blood fall***
FOR row = 94 TO 155
PUT (132, row), blood
WAIT &H3DA, 8: WAIT &H3DA, 8, 8
NEXT row

CALL bloodinvaders(Print$)
CALL background(line$)
CALL welcome(Print$)
END

SUB background (line$)
'*** LINE ***=============================
COLOR 5, 0
LINE (1, 1)-(1, 190)
COLOR 5, 0
LINE (1, 190)-(310, 190)
COLOR 5, 0
LINE (310, 190)-(310, 1)
COLOR 5, 0
LINE (1, 1)-(310, 1)
'***END of Line***========================

'***Other graphics***=====================


END SUB

DEFSNG A-Z
SUB bloodinvaders (Print$)

SCREEN 7
COLOR 4, 0
LOCATE 12, 15
PRINT "B"
COLOR 15, 0
LOCATE 12, 17
PRINT "L"
COLOR 4, 0
LOCATE 12, 19
PRINT "O"
LOCATE 12, 21
COLOR 4, 0
PRINT "O"
COLOR 4, 0
LOCATE 12, 23
PRINT "D "
LOCATE 15, 13
COLOR 4, 0
PRINT "I"
LOCATE 15, 15
COLOR 4, 0
PRINT "N"
LOCATE 15, 17
COLOR 4, 0
PRINT "V"
LOCATE 15, 19
COLOR 4, 0
PRINT "A"
LOCATE 15, 21
COLOR 15, 0
PRINT "D"
LOCATE 15, 23
COLOR 4, 0
PRINT "E"
LOCATE 15, 25
COLOR 4, 0
PRINT "R"
LOCATE 15, 27
COLOR 4, 0
PRINT "S"









END SUB

SUB welcome (Print$)
LOCATE 3, 3
COLOR 5, 0
PRINT "1."; " Let's Play"
LOCATE 23, 26
PRINT "2."; " Let's Not"

END SUB

Posted on May 6, 2008, 5:51 AM
from IP address 208.108.223.201

Respond to this message   

Goto Forum Home


Here you go, New Guy...

by


FOR row = 94 TO 155
PUT (132, row), blood, PSET '<----------- add PSET
WAIT &H3DA, 8: WAIT &H3DA, 8, 8
NEXT row

There are a number of ways you can PUT an image. If you don't specify (as in your case) it uses default XOR which mixes colors with underlying images - hence the red trail. Using PSET overwrites anything that is under it.

-Bob


Posted on May 6, 2008, 4:37 PM
from IP address 74.15.65.107

Respond to this message   

Goto Forum Home


That got rid of the trail! But also the animation?

by New Guy

The animation was also taken out of that. How can I get it to stay on the L, and keep dripping off. Then when comes into contact with blood pool it disseapears and restarts. Anyone understand what I'm trying to do?

Posted on May 7, 2008, 4:56 AM
from IP address 208.108.221.87

Respond to this message   

Goto Forum Home


*Never mind. I put it into a loop! Only problem is it gets rid of the background!

by New Guy

*

Posted on May 7, 2008, 5:07 AM
from IP address 208.108.223.201

Respond to this message   

Goto Forum Home


Again never mind! I fixed that. Now I need the blood to stay on the L!

by New Guy

Ok I need the blood to stay on the L and dissapear when it reaches point 155!Anyone know how to do that? Below is the updated version!

DECLARE SUB welcome (Print$)
DECLARE SUB background (line$)
DECLARE SUB bloodinvaders (Print$)
'*** Space invaders! ****
'**** Justin Singleton, Grogan
DEFINT A-Z
SCREEN 7
CLS

'**BLOOD**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,04,00,00,00,00
DATA 00,00,00,04,04,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ blood
PSET (x, y), blood
NEXT x
NEXT y

DIM blood%(90)
GET (0, 0)-(9, 10), blood%






'**NEEDLE**
DATA 00,00,00,00,00,00,00,00,15
DATA 00,00,00,00,15,00,15,15,00
DATA 00,00,00,00,00,15,04,15,00
DATA 00,00,00,00,15,04,15,00,00
DATA 00,15,00,15,04,15,00,15,00
DATA 00,00,15,04,15,00,00,00,00
DATA 00,00,04,15,00,00,00,00,00
DATA 00,04,00,00,15,00,00,00,00
DATA 04,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ needle
PSET (x, y), needle
NEXT x
NEXT y

DIM needle%(90)
GET (0, 0)-(9, 10), needle%


'**CROSS**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,04,15,15,04,15,15,04,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ cross
PSET (x, y), cross
NEXT x
NEXT y

DIM cross%(90)
GET (0, 0)-(9, 10), cross%


CLS
PUT (166, 102), needle
PUT (95, 86), cross
PUT (192, 86), cross
PUT (82, 110), cross
PUT (221, 110), cross
PUT (132, 94), blood
'***Making the blood fall***
DO
FOR row = 94 TO 155
PUT (132, row), blood, PSET
WAIT &H3DA, 8: WAIT &H3DA, 8, 8
WAIT &H3DA, 8: WAIT &H3DA, 8, 8

NEXT row

CALL bloodinvaders(Print$)
CALL background(line$)
CALL welcome(Print$)
LOOP
END

SUB background (line$)
'*** LINE ***=============================
COLOR 5, 0
LINE (1, 1)-(1, 190)
COLOR 5, 0
LINE (1, 190)-(310, 190)
COLOR 5, 0
LINE (310, 190)-(310, 1)
COLOR 5, 0
LINE (1, 1)-(310, 1)
'***END of Line***========================

'***Other graphics***=====================


END SUB

DEFSNG A-Z
SUB bloodinvaders (Print$)

SCREEN 7
COLOR 4, 0
LOCATE 12, 15
PRINT "B"
COLOR 15, 0
LOCATE 12, 17
PRINT "L"
COLOR 4, 0
LOCATE 12, 19
PRINT "O"
LOCATE 12, 21
COLOR 4, 0
PRINT "O"
COLOR 4, 0
LOCATE 12, 23
PRINT "D "
LOCATE 15, 13
COLOR 4, 0
PRINT "I"
LOCATE 15, 15
COLOR 4, 0
PRINT "N"
LOCATE 15, 17
COLOR 4, 0
PRINT "V"
LOCATE 15, 19
COLOR 4, 0
PRINT "A"
LOCATE 15, 21
COLOR 15, 0
PRINT "D"
LOCATE 15, 23
COLOR 4, 0
PRINT "E"
LOCATE 15, 25
COLOR 4, 0
PRINT "R"
LOCATE 15, 27
COLOR 4, 0
PRINT "S"









END SUB

SUB welcome (Print$)
LOCATE 3, 3
COLOR 5, 0
PRINT "1."; " Let's Play"
LOCATE 23, 26
PRINT "2."; " Let's Not"

END SUB

Posted on May 7, 2008, 5:13 AM
from IP address 208.108.223.201

Respond to this message   

Goto Forum Home


Um now the loop is preventing the game!

by New Guy

Um we added this to our main game but the loop I added prevents the game from starting. This is a minor complication! How do I fix this?

Posted on May 7, 2008, 5:21 AM
from IP address 208.108.223.201

Respond to this message   

Goto Forum Home


Put this in your loop

by roy


coice$ = INKEY$
IF coice$ = "1" THEN EXIT DO
IF coice$ = "2" THEN SYSTEM



Posted on May 7, 2008, 8:37 AM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


*Before the Speeling police get here, I meant choice$.

by roy

*

Posted on May 7, 2008, 9:31 AM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


Again never mind! I fixed that. Now I need the blood to stay on the L!

by New Guy

Ok I need the blood to stay on the L and dissapear when it reaches point 155!Anyone know how to do that? Below is the updated version!

DECLARE SUB welcome (Print$)
DECLARE SUB background (line$)
DECLARE SUB bloodinvaders (Print$)
'*** Space invaders! ****
'**** Justin Singleton, Grogan
DEFINT A-Z
SCREEN 7
CLS

'**BLOOD**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,04,00,00,00,00
DATA 00,00,00,04,04,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ blood
PSET (x, y), blood
NEXT x
NEXT y

DIM blood%(90)
GET (0, 0)-(9, 10), blood%






'**NEEDLE**
DATA 00,00,00,00,00,00,00,00,15
DATA 00,00,00,00,15,00,15,15,00
DATA 00,00,00,00,00,15,04,15,00
DATA 00,00,00,00,15,04,15,00,00
DATA 00,15,00,15,04,15,00,15,00
DATA 00,00,15,04,15,00,00,00,00
DATA 00,00,04,15,00,00,00,00,00
DATA 00,04,00,00,15,00,00,00,00
DATA 04,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ needle
PSET (x, y), needle
NEXT x
NEXT y

DIM needle%(90)
GET (0, 0)-(9, 10), needle%


'**CROSS**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,04,15,15,04,15,15,04,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ cross
PSET (x, y), cross
NEXT x
NEXT y

DIM cross%(90)
GET (0, 0)-(9, 10), cross%


CLS
PUT (166, 102), needle
PUT (95, 86), cross
PUT (192, 86), cross
PUT (82, 110), cross
PUT (221, 110), cross
PUT (132, 94), blood
'***Making the blood fall***
DO
FOR row = 94 TO 155
PUT (132, row), blood, PSET
WAIT &H3DA, 8: WAIT &H3DA, 8, 8
WAIT &H3DA, 8: WAIT &H3DA, 8, 8

NEXT row

CALL bloodinvaders(Print$)
CALL background(line$)
CALL welcome(Print$)
LOOP
END

SUB background (line$)
'*** LINE ***=============================
COLOR 5, 0
LINE (1, 1)-(1, 190)
COLOR 5, 0
LINE (1, 190)-(310, 190)
COLOR 5, 0
LINE (310, 190)-(310, 1)
COLOR 5, 0
LINE (1, 1)-(310, 1)
'***END of Line***========================

'***Other graphics***=====================


END SUB

DEFSNG A-Z
SUB bloodinvaders (Print$)

SCREEN 7
COLOR 4, 0
LOCATE 12, 15
PRINT "B"
COLOR 15, 0
LOCATE 12, 17
PRINT "L"
COLOR 4, 0
LOCATE 12, 19
PRINT "O"
LOCATE 12, 21
COLOR 4, 0
PRINT "O"
COLOR 4, 0
LOCATE 12, 23
PRINT "D "
LOCATE 15, 13
COLOR 4, 0
PRINT "I"
LOCATE 15, 15
COLOR 4, 0
PRINT "N"
LOCATE 15, 17
COLOR 4, 0
PRINT "V"
LOCATE 15, 19
COLOR 4, 0
PRINT "A"
LOCATE 15, 21
COLOR 15, 0
PRINT "D"
LOCATE 15, 23
COLOR 4, 0
PRINT "E"
LOCATE 15, 25
COLOR 4, 0
PRINT "R"
LOCATE 15, 27
COLOR 4, 0
PRINT "S"









END SUB

SUB welcome (Print$)
LOCATE 3, 3
COLOR 5, 0
PRINT "1."; " Let's Play"
LOCATE 23, 26
PRINT "2."; " Let's Not"

END SUB

Posted on May 7, 2008, 5:13 AM
from IP address 208.108.221.87

Respond to this message   

Goto Forum Home


If that's what you want to do, then you'll need to set aside your project for awhile...

by

...and study graphics programming a bit more. What you want to do requires a mask and is a fairly sophisticated process for a beginner. If you're interested, download the tutorials here:

http://www.network54.com/Realm/QBZips/QBZips.html


Grab both QBG1 and QBG2 and after unzipping, run QBG.EXE and click the lesson on animation. It explains about the use of masks (animating sprites while not disturbing the existing background).

This all assumes that you'd like to be able to program graphics in QBasic for yourself. If you just want the code, maybe you could team up with someone who is knowledgable about graphics.

-Bob

Posted on May 7, 2008, 9:21 PM
from IP address 70.52.182.250

Respond to this message   

Goto Forum Home


Unfortunately were the farthest ahead in the class!

by New Guy

It would be nice if we could ask a classmate about it, but everyone takes the class as a joke or for any easy grade. Were just trying to get a little more out of it! Thanks though. I think were gonna just perfect what we have and hand it in!

Posted on May 8, 2008, 3:52 AM
from IP address 24.140.121.38

Respond to this message   

Goto Forum Home


Sry I need to save this here. It got changed on my Flash!

by New Guy

Sry. This is what I have of our main menu right now!


DECLARE SUB welcome (Print$)
DECLARE SUB background (line$)
DECLARE SUB bloodinvaders (Print$)
'*** Space invaders! ****
'**** Justin Singleton, Grogan
DEFINT A-Z
SCREEN 7
CLS

'**BLOOD**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,04,00,00,00,00
DATA 00,00,00,04,04,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,04,04,04,04,04,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ blood
PSET (x, y), blood
NEXT x
NEXT y

DIM blood%(90)
GET (0, 0)-(9, 10), blood%






'**NEEDLE**
DATA 00,00,00,00,00,00,00,00,15
DATA 00,00,00,00,15,00,15,15,00
DATA 00,00,00,00,00,15,04,15,00
DATA 00,00,00,00,15,04,15,00,00
DATA 00,15,00,15,04,15,00,15,00
DATA 00,00,15,04,15,00,00,00,00
DATA 00,00,04,15,00,00,00,00,00
DATA 00,04,00,00,15,00,00,00,00
DATA 04,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ needle
PSET (x, y), needle
NEXT x
NEXT y

DIM needle%(90)
GET (0, 0)-(9, 10), needle%


'**CROSS**
DATA 00,00,00,00,00,00,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,04,15,15,04,15,15,04,00
DATA 00,04,04,04,15,04,04,04,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,15,04,00,00,00
DATA 00,00,00,04,04,04,00,00,00
DATA 00,00,00,00,00,00,00,00,00

FOR y = 0 TO 9
FOR x = 0 TO 8
READ cross
PSET (x, y), cross
NEXT x
NEXT y

DIM cross%(90)
GET (0, 0)-(9, 10), cross%

CLS
PUT (166, 102), needle
PUT (95, 86), cross
PUT (192, 86), cross
PUT (82, 110), cross
PUT (221, 110), cross
PUT (132, 94), blood


CALL bloodinvaders(Print$)
CALL background(line$)
CALL welcome(Print$)
END

SUB background (line$)
'*** LINE ***=============================
COLOR 5, 0
LINE (1, 1)-(1, 190)
COLOR 5, 0
LINE (1, 190)-(310, 190)
COLOR 5, 0
LINE (310, 190)-(310, 1)
COLOR 5, 0
LINE (1, 1)-(310, 1)
'***END of Line***========================

'***Other graphics***=====================


END SUB

DEFSNG A-Z
SUB bloodinvaders (Print$)

SCREEN 7
COLOR 4, 0
LOCATE 12, 15
PRINT "B"
COLOR 15, 0
LOCATE 12, 17
PRINT "L"
COLOR 4, 0
LOCATE 12, 19
PRINT "O"
LOCATE 12, 21
COLOR 4, 0
PRINT "O"
COLOR 4, 0
LOCATE 12, 23
PRINT "D "
LOCATE 15, 13
COLOR 4, 0
PRINT "I"
LOCATE 15, 15
COLOR 4, 0
PRINT "N"
LOCATE 15, 17
COLOR 4, 0
PRINT "V"
LOCATE 15, 19
COLOR 4, 0
PRINT "A"
LOCATE 15, 21
COLOR 15, 0
PRINT "D"
LOCATE 15, 23
COLOR 4, 0
PRINT "E"
LOCATE 15, 25
COLOR 4, 0
PRINT "R"
LOCATE 15, 27
COLOR 4, 0
PRINT "S"









END SUB

SUB welcome (Print$)
LOCATE 3, 3
COLOR 5, 0
PRINT "1."; " Let's Play"
LOCATE 23, 26
PRINT "2."; " Let's Not"

END SUB



    
This message has been edited by Solitaire1 from IP address 74.73.58.57 on May 2, 2008 1:27 PM

Posted on May 2, 2008, 5:30 AM
from IP address 208.108.223.201

Respond to this message   

Goto Forum Home


We nearly perfected your program

by roy

Did you run the last program in The Big Programs Forum that I gave you. If you are going to change the whole program then I will hand you over to Clippy with this advice. To continue you will need to guide them through POINT(0) and POINT(1).
PS.
Best of luck.

Posted on May 2, 2008, 8:35 AM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


LOL at "hand you over to Clippy"

by

Roy, ya did good, despite our hatred! You took the ball and ran well, so I cannot find anything to jerk you around on unfortunately. Well done you BRIT! Stick around because you can do things besides jerking people off..........

Ted

Posted on May 6, 2008, 9:04 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


*Looks nice

by roy

*

Posted on May 2, 2008, 1:39 PM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


Why no error message?

by Ralph

Why doesn't the following code produce an error message? The array is only DIMmed to (90), yet the GET covers an area of 15*21 = 315:

DIM blood%(90)
GET (0,0)-(14,20),blood%

I started with the OP's two lines,
DIM blood%(90)
GET (0,0)-(9,10),blood%

in which the array blood% GETs 10*11 = 110 points. Why no error?

Posted on May 3, 2008, 9:22 AM
from IP address 66.170.223.178

Respond to this message   

Goto Forum Home


Try reading back through the array

by

Place a white PSET in the bottom right corner of the area you will GET. Then read the elements going back through the array from the highest element.

FOR i = 90 TO 0 STEP -1

   IF Array(i) > 0 THEN PRINT i: EXIT FOR

NEXT

This will tell you the last element used in the array. GET may not use all of the elements available.

Ted

Posted on May 3, 2008, 10:08 AM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


Why no error message?

by Ralph

My question was, why no error message? If I try this:

DIM blood%(90)
GET (0,0)-(14,22),blood%

I get an "Illegal function call" on the last line. But not with:

DIM blood%(90)
GET (0,0)-(14,21),blood%

So, why do I get an illegal function call with y= 21, but not with y= 20?

Posted on May 3, 2008, 1:44 PM
from IP address 66.170.223.178

Respond to this message   

Goto Forum Home


Re:Why no error message?

by Ralph

Please forgive me. My last line should have referred to 22 and 21, not 21 and 20.

Posted on May 3, 2008, 2:12 PM
from IP address 66.170.223.178

Respond to this message   

Goto Forum Home


Re: Re:Why no error message?

by LaananFisher

IIRC, QBasic will throw an illegal function call if the array used in the GET statement isn't large enough to hold the bitmap data (which consists of a small header and the pixel information). From the QBasic online help:

Use bits-per-pixel-per-plane and planes values to determine the required size of the array that holds a graphics screen image. Bits-per-pixel-per-plane and planes values, along with the horizontal resolution, also determine which screen modes are compatibile:

<pre>
Horizontal
Bits-per-pixel- resolution
Screen mode per-plane Planes (in pixels)
---------------------------- --------------- ------ -----------
1 2 1 320
2, 4, 11 1 1 640
3 1 1 720
7 1 4 320
8, 9(> 64K video memory), 12 1 4 640
9(64K video memory), 10 1 2 640
13 8 1 320
</pre>

The following formula gives the required size, in bytes, of an array used to hold a captured image:

<pre>
size% = 4 + INT(((PMAP (x2!, 0) - PMAP (x1!, 0) + 1) *
(bits-per-pixel-per-plane%) + 7) / 8) * planes% *
(PMAP (y2!, 1) - PMAP (y1!, 1) + 1)
</pre>

GET and PUT operations are compatible in screen modes with the same horizontal resolution and bits-per-pixel-per-plane and planes values. For example, screen modes 2, 4, and 11 are compatible, and screen modes 8 and 12 are compatible.

Posted on May 3, 2008, 6:31 PM
from IP address 67.177.189.44

Respond to this message   

Goto Forum Home


Maybe this will clear things up a bit

by LaananFisher

Ah, sorry about the formatting of the previous post. Here's a partial program that should help understand what all that gibberish means:

http://copy-pasta.com/pasta156969

(I would post the code here or in "Tips and Tricks", but the <pre></pre> tags don't work there either, plus copy-pasta.com has a QB syntax highlighter, and you can click on keywords to get more help, a little buggy but still pretty helpful.)

Posted on May 3, 2008, 7:57 PM
from IP address 67.177.189.44

Respond to this message   

Goto Forum Home


Here is the Function code for any screen available in QB

by

DEFINT A-Z
DECLARE FUNCTION ImageBufferSize (w, d, mode)

INPUT "Enter Screen mode: ", screenmode
INPUT "Enter Image Width: ", wide
INPUT "Enter Image Depth: ", deep

Bytes = ImageBufferSize(wide, deep, screenmode)

PRINT "Bytes ="; Bytes

PRINT "Integers ="; INT((Bytes + 1) / 2)
PRINT "Longs ="; INT ((Bytes +3) / 4)
PRINT "Doubles ="; INT((Bytes + 7) / 8)

FUNCTION ImageBufferSize (wide, deep, Screenmode)

SELECT CASE screenmode
  CASE 1: BPPlane = 2: Planes = 1
  CASE 2, 3, 4, 11: BPPlane = 1: Planes = 1
  CASE 7, 8, 9, 12: BPPlane = 1: Planes = 4
  CASE 10: BPPlane = 1: Planes = 2
  CASE 13: BPPlane = 8: Planes = 1
  CASE ELSE: BPPlane = 0: Planes = 0
END SELECT

ImageBufferSize = 4 + INT((wide * BPPlane + 7) / 8) * (deep * Planes)

END FUNCTION



    
This message has been edited by burger2227 from IP address 71.60.226.47 on May 4, 2008 3:39 PM

Posted on May 4, 2008, 3:15 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


Re: Here is the Function code for any screen available in QB

by LaananFisher

Clippy, if you're going to copy code, it might be wise to copy without modification, to avoid introducing bugs and/or misinformation.

Bytes / whatever

will round down if possible, so you end up with a value that is too small. (the INT business isn't just fluff, it's necessary)

Just some nitpicking things:
- image "depth" usually refers to the number of unique colors that can be represented by a pixel. "height" is probably more appropriate. Or perhaps, "columns", "rows"..
- "BPPlane": unless "B" stands for "Bytes per pixel", it should probably be "BppPerPlane", as it represents the number of bytes per pixel per plane.
- Good luck.

Posted on May 4, 2008, 3:30 PM
from IP address 67.177.189.44

Respond to this message   

Goto Forum Home


* BYTE ME ASS ..... you were too lazy to do it!

by



    
This message has been edited by burger2227 from IP address 71.60.226.47 on May 4, 2008 3:40 PM

Posted on May 4, 2008, 3:34 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


Re: * BYTE ME ASS ..... you were too lazy to do it!

by LaananFisher

BTW, thanks for taking the time to format the code snippet, Clippy. Sorry if I came off as rude, I didn't mean to be.

Posted on May 5, 2008, 9:53 PM
from IP address 67.177.189.44

Respond to this message   

Goto Forum Home


No problem

by

I really only saw a need for Integers originally, but I think that the Function value should actually be LONG to allow for larger dimensioned  GET areas. The present code only allows for values under 32768. Otherwise it will Overflow.

As to the rounding method, I just rounded the values up in my head until you commented...........

I never really saw a reason to use Double values in the array.

Ted

Posted on May 6, 2008, 8:25 AM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


* s/bytes per/bits per/g, sorry

by LaananFisher

Posted on May 4, 2008, 3:34 PM
from IP address 67.177.189.44

Respond to this message   

Goto Forum Home


Newguy's program should not give an error

by roy

because you deduct one from each number before multiplying but I do not understand why 14,21 does not give an error, even after reading LaananFisher's post. We need a better explanation from one of our experts in this.

Posted on May 4, 2008, 1:36 PM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


Re: Newguy's program should not give an error

by LaananFisher

(0,0)-(14,21) is 15x22, plug that into the formula for screen mode 7 and you get a required number of bytes of 180, which is 90 INTEGERs worth.

(0,0)-(14,22) is 15x23, plug that in and you get a required number of bytes of 188, or 94 INTEGERs worth.

Keep in mind that different screen modes store color (pixel) information differently, some use a full byte, while some use only a partial byte, others interleave different pixels within the same byte, etc., etc. You don't need to know the details (unless you are working directly with video/image buffer memory), you only need to know that formula. Something like,

DIM image%(w*h)

should be fine for all screen modes, but you should at least try and understand what's going on. As it is, the above declaration wastes a good deal of space, and it's wise to avoid that, particularly when running a program in the IDE.

Posted on May 4, 2008, 1:56 PM
from IP address 67.177.189.44

Respond to this message   

Goto Forum Home


*Thanks

by roy

*

Posted on May 4, 2008, 3:48 PM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


Using INKEY$

by noob08

I am making a game and I currently have a title screen. I am trying to figure out how to start the game by using INKEY$. I want it to start the game (call the subprogram for the game) if you press "1" and exit the game if you press "esc". I have been trying to get this to work for a while and I can't figure it out. Any help would be appreciated.

Posted on Apr 30, 2008, 7:55 PM
from IP address 24.140.126.214

Respond to this message   

Goto Forum Home


INKEY$

by Pete

CLS
DO
mykey$ = INKEY$
IF mykey$ = CHR$(27) THEN END
IF mykey$ <> "" THEN
PRINT mykey$, "ASCII Value(s):"; ASC(MID$(mykey$, 1, 1));
IF LEN(mykey$) = 2 THEN PRINT ASC(MID$(mykey$, 2, 1)) ELSE PRINT
END IF
LOOP

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

This routine prints the key pressed and the ASCII character associated with it. You need to know those values, like CHR$(27), which is the ESC key.

The ASCII values are in QB Help. Type ASC and press F1 to see the ASCII character set table.

Pete

 

Posted on Apr 30, 2008, 8:31 PM
from IP address 70.177.5.114

Respond to this message   

Goto Forum Home


I need help setting up this Program

by Scott

I need big time help... i need to set up a program dealing with numbers....positives...neatives..etc... ill give the exact problem to the person willing to help me..id appreciate it so MUCHHHHHHHHHH

Posted on Apr 28, 2008, 9:10 PM
from IP address 99.142.45.249

Respond to this message   

Goto Forum Home


* Post what code you have made so far.

by

Posted on Apr 28, 2008, 10:20 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


Re: * Post what code you have made so far.

by SCOTT

Im using the data=list Containing twenty Numbers...how many are positive , negative , zero

..I am using "read" and "data" statements..

I am corporating loops, reads, trip-codes, decisions, etc....

I cannot change the Data elements,

im trying to use 21 as my trip code...

the output i believe should be centered on the page, and the values are centered under the headings...

DATA: 10, 2, 0, -6, 5,72, 60,1,61,4,-80,-14,90,89,100,-42,17,55,48,21

i NEED help designing the flow chart...

Anybody have any thoughts or suggestions..

Also.... i need to put it into QBASIC..so i need assistance on the exact computer text to write into the PROGRAM..

HELP IS GREATLY NEEDED....!

Posted on Apr 28, 2008, 10:59 PM
from IP address 99.142.45.249

Respond to this message   

Goto Forum Home


*You have still not shown us your attempt at this

by roy

*

Posted on Apr 29, 2008, 2:11 AM
from IP address 82.18.11.35

Respond to this message   

Goto Forum Home


Re: *You have still not shown us your attempt at this

by Scott

im havingf difficulty starting it off...! can anybody assist me...!

Posted on Apr 29, 2008, 7:23 AM
from IP address 99.142.45.249

Respond to this message   

Goto Forum Home


You need to...

by Pete

1) READ the data and make a variable to go with the read statement, like number%

2) Make a counter for numbers > 0, 0, and numbers less than 0.

3) Print the results.

Check the READ statement and make a simple array like results(3) where:

results(1) = the count for numbers less than zero
results(2) = the count for numbers equal to zero
results(3) = the count for numbers greater than zero

Then you just make a for next loop 1-3 to pront the results.

If you don't want or are not permitted to use an array, just make three variables like:

numbersbelowzero%

numbersequaltozero%

numbersgreaterthanzero%

Then each time the READ statement gets a number, you evaluate it through a SELECT CASE or a three-way IF/THEN Statement.

SELECT CASE [You figure this part out]
CASE is < 0: numbersbelowzero% = numbersbelowzero% + 1
CASE 0:  [You figure this part out]
CASE is > 0:  [You figure this part out]
END SELECT

or the IF THEN...

IF [The number Read] < 0 THEN
numbersbelowzero% = numbersbelowzero% + 1
ELSE
IF [The number Read] = 0 THEN
[You figure this part out]
ELSE
[You figure this part out]
END IF

When all are counted, you need to read about the PRINT statement in QB Help and print the results...

PRINT "Numbers below zero: "; numbersbelowzero%
etc.

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

Pete

 

 

 


 

 

Posted on Apr 29, 2008, 2:43 PM
from IP address 70.177.5.114

Respond to this message   

Goto Forum Home


You don't need SELECT CASE or IF statements. Just use SGN

by qbguy

DIM A(0 TO 2)
FOR I = 1 TO 20
  READ J
  A(SGN(J) + 1) = A(SGN(J) + 1) + 1
NEXT
DATA 10,2,0,-6,5,72,60,1,61,4,-80,-14,90,89,100,-42,17,55,48,21


To center the numbers and headings, you just use TAB and some arithmetic. To find out how much you tab over, you just do 40-(length of string/2).

So you'd to this:

CLS
PRINT TAB(36); "-------"
PRINT TAB(36); "RESULTS"
PRINT TAB(36); "-------"
PRINT
PRINT TAB(9); "# OF POSITIVE NUMBERS    # OF ZEROS      # OF NEGATIVE NUMBERS"
PRINT TAB(9); "---------------------    ----------      ---------------------"
PRINT a(0); a(1); a(2) 'you would actually use print using to center it under the headings

Posted on Apr 29, 2008, 3:02 PM
from IP address 75.9.211.189

Respond to this message   

Goto Forum Home


qbguy: This is a homework assignment.

by Solitaire

We don't supply code for students working on homework assignments. The only reason I haven't deleted your post is because it's probably more advanced than the class has gotten to so far, and the teacher (hopefully) will be able to spot it as something the student did not do for himself.

Posted on Apr 29, 2008, 4:53 PM
from IP address 74.73.58.57

Respond to this message   

Goto Forum Home


* Solitaire please delete it and watch his STUPID posts!

by

Posted on Apr 29, 2008, 10:45 PM
from IP address 71.60.226.47

Respond to this message   

Goto Forum Home


*Too late, The OP has already seen the code, and Bob's post makes reference to it.

by Solitaire

Posted on Apr 30, 2008, 5:32 PM
from IP address 74.73.58.57

Respond to this message   

Goto Forum Home


You could dim the array from -1 to 1 instead of adding 1 to the index

by Bob

DIM A(-1 TO 1)
FOR I = 1 TO 20
READ J
A(SGN(J)) = A(SGN(J)) + 1
NEXT
DATA 10,2,0,-6,5,72,60,1,61,4,-80,-14,90,89,100,-42,17,55,48,21

Actually, FORTRAN 77 has a "ternary if" whihc branches based on x < 0, x = 0, x > 0

IF (e) label1, label2, label3

I think it was depreciated in FORTRAN 90 because it is not very structured.

Posted on Apr 29, 2008, 5:21 PM
from IP address 85.195.123.25

Respond to this message   

Goto Forum Home


Scott: You need to write your own homework code.

by Solitaire