 DOS Games Discussion A message board to talk about DOS games, get help, and find old games. Do NOT post warez or abandonware requests please


Author 
Message 
baro_unlogged Guest

Posted: Sat Dec 11, 2004 12:29 pm
Post subject: 


uuum... right.
pset (x coordinate, y coordinate) colour
easy enough. 

Back to top 


Jack Bond Guest

Posted: Sun Dec 19, 2004 1:41 pm
Post subject: 


nevermind I'm past that.
I REEEEEEEEEEEEEEELY need to know how to bind space bar. Just like you bind arrows. I want to put like:
10 on key "however you do space bar" gosub 1000
20 goto 10
1000 print"success"
1010 return
and the same for the f key. 

Back to top 


Guest

Posted: Mon Dec 20, 2004 7:10 am
Post subject: Relsoft 


Untested:
Code:  10 K$ = inkey$
20 if K$ = chr$(32) then gosub 100
30 if K$ = "" then 10
90 end
100 Print "Pressed Space"
110 return 
[/code] 

Back to top 


Jack Bond Guest


Back to top 


Guest


Back to top 


windes Newbie
Joined: 08 Dec 2014 Posts: 1

Posted: Mon Dec 08, 2014 1:42 am
Post subject: Load a BMP in GWBasic 


One thing you need to remember: GWBASIC has a lot of limitations.. Here's the code that will give you the possiblity to load a 16X16 /16colors bitmap. You can't load anything that would exceed 255bytes..
Don't forget: Load gwbasic at dos prompt with switch /s:255
At line 501, change the filename and location to show on the display. Use Screen 7.. Or Screen 9 for better results.
501 ZOOM=1:BMPFILE$="C:\BMP16.BMP":LOCX=100:LOCY=100 'DEFIN AS YOU WANT
502 DIM BYT(512)
503 OPEN "r",1,BMPFILE$:FIELD 1,3 AS F$:GET 1,1:FLN=ASC(MID$(F$,3,1)):CLOSE #1
504 OPEN "r",1,BMPFILE$,FLN:FIELD 1, FLN AS A$:GET 1,1
505 FOR I = 1 TO FLN
506 BYT(I)=ASC(MID$(A$,I,1))
507 NEXT I
508 W=BYT(19):H=BYT(23)
509 DIM PX(W,H)
510 XI=2
511 FOR X=FLN TO FLN((W*H)/2) STEP1
512 XI=XI+2:IF XI=W THEN YI=YI+1:XI=0:IF YI=H THEN GOTO 517
513 WD$=HEX$(BYT(X)):IF LEN(WD$)=1 THEN WD$="0"+WD$
514 PX((W1)XI,YI)=ASC(MID$(WD$,2,1))
515 PX((W1)(XI+1),YI)=ASC(MID$(WD$,1,1))
516 NEXT X
517 FOR X=0 TO W1
518 FOR Y=0 TO H1
519 GOSUB 530'GET cOLOR
520 IF ZOOM=0 THEN ZOOM=1
521 IF ZOOM=1 THEN PSET(LOCX+X,LOCY+Y),PX(X,Y) ELSE LINE(LOCX+(X*ZOOM),LOCY+(Y*ZOOM))(LOCX+ZOOM1+(X*ZOOM),LOCY+ZOOM1+(Y*ZOOM)),PX(X,Y),Bf
522 NEXT Y:NEXT X
523 END
530 'Get COLOR
531 IF PX(X,Y)=70 THEN PX(X,Y)=15:RETURN'
532 IF PX(X,Y)=69 THEN PX(X,Y)=11:RETURN
533 IF PX(X,Y)=68 THEN PX(X,Y)=13:RETURN
534 IF PX(X,Y)=67 THEN PX(X,Y)=9:RETURN
535 IF PX(X,Y)=66 THEN PX(X,Y)=14:RETURN
536 IF PX(X,Y)=65 THEN PX(X,Y)=10:RETURN
537 IF PX(X,Y)=57 THEN PX(X,Y)=12:RETURN
538 IF PX(X,Y)=56 THEN PX(X,Y)=7:RETURN
539 IF PX(X,Y)=55 THEN PX(X,Y)=8:RETURN
540 IF PX(X,Y)=54 THEN PX(X,Y)=3:RETURN
541 IF PX(X,Y)=53 THEN PX(X,Y)=5:RETURN
542 IF PX(X,Y)=52 THEN PX(X,Y)=1:RETURN '
543 IF PX(X,Y)=51 THEN PX(X,Y)=6:RETURN
544 IF PX(X,Y)=50 THEN PX(X,Y)=2:RETURN
545 IF PX(X,Y)=49 THEN PX(X,Y)=4:RETURN '
546 IF PX(X,Y)=48 THEN PX(X,Y)=0:RETURN
550 RETURN


Back to top 


tienkhoanguyen PSEUDOCODER
Joined: 05 Sep 2014 Posts: 2683 Location: Texas

Posted: Wed Sep 16, 2015 8:41 pm
Post subject: From my personal experiences with Commodore BASIC... 


When I first started out on a different computer, I used BASIC that is built into the computer itself. Assembly language was actually very hard at that time (over 30 years ago). You actually had to put in all numbers for assembly instructions. However this was the only way to go for maximum speed of the computer.
Usually, BASIC is an "interpreted" language. This means that it continues to process the commands as it encounters it into machine form. This is very slow. So people who need to use speed for graphics display use close to machine language as possible like assembly.
I don't know about the BASIC you are talking about, however, Commodore 64 BASIC allows numbers to be enterred for assembly language speed.
If you are programming in MSDOS and would like to be a PRO I would recommend using Borland Turbo Assembler 4.1 for speed. Maybe you could somehow integrate it into the BASIC language itself like I do for my C language.
Speaking from my own point of view, the best package for programming MSDOS games is Borland Turbo Assembler 4.1 and Borland Turbo C 2.01. Last I know they are still available from Embarcadero website. They have taken over Borland's old programming languages from last I know. The last time I talked to them was like last year.
Here is a great way to start on your journey to programming games, ...
Maybe you won't be a PRO over night however I'm sure you'll be like me.
Disclaimer: I've been told my programming is spaghetti sloppy hehe
http://edn.embarcadero.com/article/20841


Back to top 


tienkhoanguyen PSEUDOCODER
Joined: 05 Sep 2014 Posts: 2683 Location: Texas

Posted: Wed Sep 16, 2015 8:47 pm
Post subject: Similarities to BASIC using C... 


Borland Turbo C 2.01 has the ability to be similar to BASIC in that you can make your own words and such. Just take your time. I've gone through the Borland Turbo C 2.01 book a bit of the ways and they've seem to cover everything you need to know to program games the way a PRO does it. Not that I know what a PRO does 

Back to top 


tienkhoanguyen PSEUDOCODER
Joined: 05 Sep 2014 Posts: 2683 Location: Texas

Posted: Wed Sep 16, 2015 8:49 pm
Post subject: Re: Load a BMP in GWBasic 


windes wrote:  One thing you need to remember: GWBASIC has a lot of limitations.. Here's the code that will give you the possiblity to load a 16X16 /16colors bitmap. You can't load anything that would exceed 255bytes..
Don't forget: Load gwbasic at dos prompt with switch /s:255
At line 501, change the filename and location to show on the display. Use Screen 7.. Or Screen 9 for better results.
501 ZOOM=1:BMPFILE$="C:\BMP16.BMP":LOCX=100:LOCY=100 'DEFIN AS YOU WANT
502 DIM BYT(512)
503 OPEN "r",1,BMPFILE$:FIELD 1,3 AS F$:GET 1,1:FLN=ASC(MID$(F$,3,1)):CLOSE #1
504 OPEN "r",1,BMPFILE$,FLN:FIELD 1, FLN AS A$:GET 1,1
505 FOR I = 1 TO FLN
506 BYT(I)=ASC(MID$(A$,I,1))
507 NEXT I
508 W=BYT(19):H=BYT(23)
509 DIM PX(W,H)
510 XI=2
511 FOR X=FLN TO FLN((W*H)/2) STEP1
512 XI=XI+2:IF XI=W THEN YI=YI+1:XI=0:IF YI=H THEN GOTO 517
513 WD$=HEX$(BYT(X)):IF LEN(WD$)=1 THEN WD$="0"+WD$
514 PX((W1)XI,YI)=ASC(MID$(WD$,2,1))
515 PX((W1)(XI+1),YI)=ASC(MID$(WD$,1,1))
516 NEXT X
517 FOR X=0 TO W1
518 FOR Y=0 TO H1
519 GOSUB 530'GET cOLOR
520 IF ZOOM=0 THEN ZOOM=1
521 IF ZOOM=1 THEN PSET(LOCX+X,LOCY+Y),PX(X,Y) ELSE LINE(LOCX+(X*ZOOM),LOCY+(Y*ZOOM))(LOCX+ZOOM1+(X*ZOOM),LOCY+ZOOM1+(Y*ZOOM)),PX(X,Y),Bf
522 NEXT Y:NEXT X
523 END
530 'Get COLOR
531 IF PX(X,Y)=70 THEN PX(X,Y)=15:RETURN'
532 IF PX(X,Y)=69 THEN PX(X,Y)=11:RETURN
533 IF PX(X,Y)=68 THEN PX(X,Y)=13:RETURN
534 IF PX(X,Y)=67 THEN PX(X,Y)=9:RETURN
535 IF PX(X,Y)=66 THEN PX(X,Y)=14:RETURN
536 IF PX(X,Y)=65 THEN PX(X,Y)=10:RETURN
537 IF PX(X,Y)=57 THEN PX(X,Y)=12:RETURN
538 IF PX(X,Y)=56 THEN PX(X,Y)=7:RETURN
539 IF PX(X,Y)=55 THEN PX(X,Y)=8:RETURN
540 IF PX(X,Y)=54 THEN PX(X,Y)=3:RETURN
541 IF PX(X,Y)=53 THEN PX(X,Y)=5:RETURN
542 IF PX(X,Y)=52 THEN PX(X,Y)=1:RETURN '
543 IF PX(X,Y)=51 THEN PX(X,Y)=6:RETURN
544 IF PX(X,Y)=50 THEN PX(X,Y)=2:RETURN
545 IF PX(X,Y)=49 THEN PX(X,Y)=4:RETURN '
546 IF PX(X,Y)=48 THEN PX(X,Y)=0:RETURN
550 RETURN

JESUS!hehe This person seems to know what their talking about. I recognize many similarities to Commodore 64 BASIC. 

Back to top 


fredaskew Newbie
Joined: 28 Jun 2016 Posts: 2

Posted: Tue Jun 28, 2016 4:58 am
Post subject: 


I too use GW basic. 

Back to top 



Powered by phpBB © 2001, 2005 phpBB Group and Ask an Expert
Also powered by Darren and the other admin and mods' hard work! ;)

