Posts: 22
Threads: 9
Joined: Mar 2004
So I'm back!
Here's my question this time.
If I want to move an object to the left on the screen I type like this:
IF press$ = "a" then x = x - 1
and up
IF press$ = "w" then y = y - 1
But what if I want to move it up, left holding down "a" and "w" at the same time, how do I do that?
Posts: 2,765
Threads: 138
Joined: Nov 2002
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 719
Threads: 72
Joined: Mar 2003
u don't need multi-keys, but thats preferable.....
Code:
'Map Movement
SUB Update.Map(plx as integer, ply as integer, mpx as integer, mpy as integer)
'MPX&MPY is top left coords of map
for smx = mpx to (mpx + Total_Screen_Tiles_X)
for smy = mpy to (mpy + Total_Screen_Tiles_Y)
img=Map(smx,smy).tileindex
put (smx-Xres,smy-yres), ImageArray(img)
next
next
END SUB
Posts: 1,845
Threads: 44
Joined: Aug 2002
A custom keyboard handler is preferable for any game, simply because they are a lot faster.
But if you don't want to use a CKH, you could assign keys for moving upperleft or so... (Q)
Posts: 719
Threads: 72
Joined: Mar 2003
If u want fast keyboarding:
Code:
dim keys as LONG
do
'There is some code to clear keyboard buffer, but i don't know it off
'the top of my head
keys = INP(&H60) 'Get Keyboard Scan Code
if Keys = &H1 'ESC
exit do
end if
loop
end
Posts: 31
Threads: 7
Joined: Nov 2002
Code:
DEF SEG = &H40
POKE &H1A, PEEK(&H1C)
DEF SEG
i think
Posts: 719
Threads: 72
Joined: Mar 2003
It looks right.......i'd assume that werks......
Good Job, man~
Alex~