Mouse,sound and motion questions

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Guest

Mouse,sound and motion questions

Post by Guest »

:?: I need some help with Qbasic in several diffurent topics I would be more than grateful if you could answer them.

How do you insert the mouse in Qbasic ?
I need some plain intructions to insert the mouse in Qbasic.



How do you add sound-music to Qbasic ?
I need to learn how to add sound and/or music in Qbasic for this game I am programming.



How do make moving characters (one or more)
I need to create moving characters for a game I am making
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

1)

Code: Select all

REM $DYNAMIC
DEFINT A-Z
SUB Mouse (AX%, bx%, CX%, DX%)
MouseData$ = "5589E58B5E0C8B07508B5E0A8B07508B5E088B0F8B5E068B175B581E07CD33538B5E0C8907588B5E0A89078B5E08890F8B5E0689175DCA0800"
Mousei$ = SPACE$(57)
FOR I% = 0 TO 56
 a$ = MID$(MouseData$, 1 + I% * 2, 2)
 H$ = CHR$(VAL("&H" + a$))
 MID$(Mousei$, 1 + I%, 1) = H$
NEXT I%
DEF SEG = VARSEG(Mousei$)
Mousey% = SADD(Mousei$)
CALL Absolute(AX%, bx%, CX%, DX%, Mousey%)
'AX% = 0                        'MouseInit
'AX% = 1                        'MouseShow
'AX% = 2                        'MouseHide
'AX% = 3                        'MouseStatus
'AX% = 4                        'MousePut
'CX% = x%                       'MousePut
'DX% = y%                       'MousePut
'lb% = -((bx% AND 1) <> 0)      'MouseStatus
'rb% = -((bx% AND 2) <> 0)      'MouseStatus
'Xmouse% = CX%                  'MouseStatus
'Ymouse% = DX%                  'MouseStatus
END SUB
2) Look around for BWSB, uGL (mod routines) or DMAPLAY

3)

Code: Select all

screen 13
for a = 0 to 100
 pset (a-1, 100), 0   'erasae the old image (only a pixel in the ex.)
 pset (a,100), 15 'draw the chacarcter (only a pixel in the ex.)
next
User avatar
Pete
Site Admin
Posts: 887
Joined: Sun Dec 07, 2003 9:10 pm
Location: Candor, NY
Contact:

Post by Pete »

If you need more help, check the tutorials section. I have found several tutorials you might find useful, but there are many more (over 300 total).

Using the Mouse:
http://www.petesqbsite.com/sections/tut ... tutor4.txt

Sound tutorials:
http://www.petesqbsite.com/sections/tut ... html#Sound

Making (character) animations:
http://www.petesqbsite.com/sections/tut ... aphics.txt
http://www.petesqbsite.com/sections/tut ... _smith.htm
http://www.petesqbsite.com/sections/tut ... nimate.zip
Anonymous

Post by Anonymous »

Personally, I think Mouse Tutorials that follow the QB Interrupt way are easier to understand than QB Absolutes. This is because most people who ask how to use the mouse in QB have limited assembly knowledge.

*hmn* Where did I leave Plasma's Mouse Tutorial?
Post Reply