BMP's in gwbasic

Discuss popular GCS tools like ZZT, Megazeux and Adventure Game Studio, as well as programming and other topics related to game design.
baro_unlogged

Post by baro_unlogged » Sat Dec 11, 2004 12:29 pm

uuum... right.

pset (x coordinate, y coordinate) colour

easy enough.

Jack Bond

Post by Jack Bond » Sun Dec 19, 2004 1:41 pm

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.

Guest

Relsoft

Post by Guest » Mon Dec 20, 2004 7:10 am

Untested:

Code: Select all

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]

Jack Bond

Post by Jack Bond » Mon Dec 20, 2004 8:22 am

ok I'll try that.
You guys are much more reliable than the people at www.axlstfc.com
so heres a reward.

http://www.newgrounds.com/portal/view/176901 http://www.newgrounds.com/portal/view/111291 http://www.newgrounds.com/portal/view/49489 http://www.newgrounds.com/portal/view/176901
http://www.newgrounds.com/portal/view/176901

1. DBZ in a nutshell
2. yu-gi-oh in a nutshell
3. pokemon in a nutshell
4. Sonic the hedgehog in a nutshell
5. rag doll game

Guest

Post by Guest » Mon Dec 20, 2004 8:24 am

sry last one is sonic again

http://www.stickpage.com/ragdollgameplay.shtml

that's it

windes
Newbie
Newbie
Posts: 1
Joined: Mon Dec 08, 2014 1:35 am

Load a BMP in GWBasic

Post by windes » Mon Dec 08, 2014 1:42 am

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) STEP-1
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((W-1)-XI,YI)=ASC(MID$(WD$,2,1))
515 PX((W-1)-(XI+1),YI)=ASC(MID$(WD$,1,1))
516 NEXT X
517 FOR X=0 TO W-1
518 FOR Y=0 TO H-1
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+ZOOM-1+(X*ZOOM),LOCY+ZOOM-1+(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

User avatar
tienkhoanguyen
PSEUDOCODER
Posts: 2664
Joined: Fri Sep 05, 2014 9:43 am
Location: Texas

From my personal experiences with Commodore BASIC...

Post by tienkhoanguyen » Wed Sep 16, 2015 8:41 pm

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 MS-DOS 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 MS-DOS 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

:laugh:
God, Jesus Christ, is number one!hehe
Jesus Christ!hehe
Bless Jesus Christ!
Then please bless my mom.
Honour to my mom Huong Thi Vu
Honour to my dad Thuy Binh Nguyen
Love to cousin Carl Anh Cuong Cao Vu
Thank you Jesus Christ.

User avatar
tienkhoanguyen
PSEUDOCODER
Posts: 2664
Joined: Fri Sep 05, 2014 9:43 am
Location: Texas

Similarities to BASIC using C...

Post by tienkhoanguyen » Wed Sep 16, 2015 8:47 pm

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 :laugh:
God, Jesus Christ, is number one!hehe
Jesus Christ!hehe
Bless Jesus Christ!
Then please bless my mom.
Honour to my mom Huong Thi Vu
Honour to my dad Thuy Binh Nguyen
Love to cousin Carl Anh Cuong Cao Vu
Thank you Jesus Christ.

User avatar
tienkhoanguyen
PSEUDOCODER
Posts: 2664
Joined: Fri Sep 05, 2014 9:43 am
Location: Texas

Re: Load a BMP in GWBasic

Post by tienkhoanguyen » Wed Sep 16, 2015 8:49 pm

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) STEP-1
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((W-1)-XI,YI)=ASC(MID$(WD$,2,1))
515 PX((W-1)-(XI+1),YI)=ASC(MID$(WD$,1,1))
516 NEXT X
517 FOR X=0 TO W-1
518 FOR Y=0 TO H-1
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+ZOOM-1+(X*ZOOM),LOCY+ZOOM-1+(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.
God, Jesus Christ, is number one!hehe
Jesus Christ!hehe
Bless Jesus Christ!
Then please bless my mom.
Honour to my mom Huong Thi Vu
Honour to my dad Thuy Binh Nguyen
Love to cousin Carl Anh Cuong Cao Vu
Thank you Jesus Christ.

fredaskew
Newbie
Newbie
Posts: 2
Joined: Tue Jun 28, 2016 4:57 am

Post by fredaskew » Tue Jun 28, 2016 4:58 am

I too use GW basic.

Post Reply