Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mouse input/movement by numpad PROBLEMS
#41
this code is driving me nuts, and whoever mentioned PSET with larger sprites, i wont have to, ill make 16x16 tiles and place them, now for the ending, i still dont get wat ur saying, wat i bascally want is a kida fade effect where it goes from top left to bottom rite just putting black pixels, can u help me just do that
Reply
#42
Code:
' A simple character moving program

DEFINT A-Z

SCREEN 13
CLS

' This is the srite's design
PSET (4, 1), 8: PSET (7, 1), 8: PSET (8, 1), 8: PSET (12, 1), 8: PSET (13, 1), 8: PSET (3, 2), 8: PSET (4, 2), 14: PSET (5, 2), 8: PSET (6, 2), 8: PSET (7, 2), 14: PSET (8, 2), 14: PSET (9, 2), 8: PSET (11, 2), 8: PSET (12, 2), 14: PSET (13, 2), 8: _
    PSET (3, 3), 8: PSET (4, 3), 14: PSET (5, 3), 14: PSET (6, 3), 14: PSET (7, 3), 14: PSET (8, 3), 14: PSET (9, 3), 14: PSET (10, 3), 8: PSET (11, 3), 14: PSET (12, 3), 14: PSET (13, 3), 14: PSET (14, 3), 8: PSET (15, 3), 8: PSET (2, 4), 8: PSET ( _
3, 4), 14: PSET (4, 4), 14: PSET (5, 4), 14: PSET (6, 4), 14: PSET (7, 4), 14: PSET (8, 4), 14: PSET (9, 4), 8: PSET (10, 4), 14: PSET (11, 4), 14: PSET (12, 4), 14: PSET (13, 4), 14: PSET (14, 4), 14: PSET (15, 4), 14: PSET (16, 4), 8: PSET (3, 5) _
, 8: PSET (4, 5), 14: PSET (5, 5), 8: PSET (6, 5), 14: PSET (7, 5), 66: PSET (8, 5), 66: PSET (9, 5), 14: PSET (10, 5), 14: PSET (11, 5), 14: PSET (12, 5), 8: PSET (13, 5), 14: PSET (14, 5), 14: PSET (15, 5), 8: PSET (4, 6), 8: PSET (5, 6), 8: PSET  _
(6, 6), 66: PSET (7, 6), 66: PSET (8, 6), 66: PSET (9, 6), 66: PSET (10, 6), 14: PSET (11, 6), 14: PSET (12, 6), 8: PSET (13, 6), 14: PSET (14, 6), 8: PSET (5, 7), 8: PSET (6, 7), 66: PSET (7, 7), 16: PSET (8, 7), 66: PSET (9, 7), 66: PSET (10, 7),  _
16: PSET (11, 7), 66: PSET (12, 7), 8: PSET (13, 7), 8: PSET (5, 8), 8: PSET (6, 8), 66: PSET (7, 8), 16: PSET (8, 8), 66: PSET (9, 8), 66: PSET (10, 8), 16: PSET (11, 8), 66: PSET (12, 8), 8: PSET (3, 9), 8: PSET (4, 9), 8: PSET (5, 9), 66: PSET (6 _
, 9), 8: PSET (7, 9), 66: PSET (8, 9), 66: PSET (9, 9), 66: PSET (10, 9), 66: PSET (11, 9), 8: PSET (12, 9), 66: PSET (13, 9), 8: PSET (14, 9), 8: PSET (2, 10), 8: PSET (3, 10), 66: PSET (4, 10), 66: PSET (5, 10), 64: PSET (6, 10), 15: PSET (7, 10) _
, 8: PSET (8, 10), 8: PSET (9, 10), 8: PSET (10, 10), 8: PSET (11, 10), 15: PSET (12, 10), 64: PSET (13, 10), 66: PSET (14, 10), 66: PSET (15, 10), 8: PSET (1, 11), 8: PSET (2, 11), 66: PSET (3, 11), 64: PSET (4, 11), 64: PSET (5, 11), 64: PSET (6,  _
11), 15: PSET (7, 11), 15: PSET (8, 11), 15: PSET (9, 11), 15: PSET (10, 11), 15: PSET (11, 11), 15: PSET (12, 11), 64: PSET (13, 11), 64: PSET (14, 11), 64: PSET (15, 11), 66: PSET (16, 11), 8: PSET (1, 12), 8: PSET (2, 12), 64: PSET (3, 12), 64:  _
PSET (4, 12), 8: PSET (5, 12), 8: PSET (6, 12), 8: PSET (7, 12), 15: PSET (8, 12), 15: PSET (9, 12), 15: PSET (10, 12), 15: PSET (11, 12), 8: PSET (12, 12), 8: PSET (13, 12), 8: PSET (14, 12), 64: PSET (15, 12), 64: PSET (16, 12), 8: PSET (1, 13), 8 _
: PSET (2, 13), 8: PSET (3, 13), 8: PSET (5, 13), 8: PSET (6, 13), 9: PSET (7, 13), 8: PSET (8, 13), 8: PSET (9, 13), 8: PSET (10, 13), 8: PSET (11, 13), 9: PSET (12, 13), 8: PSET (14, 13), 8: PSET (15, 13), 8: PSET (16, 13), 8: PSET (5, 14), 8:  _
PSET (6, 14), 9: PSET (7, 14), 9: PSET (8, 14), 9: PSET (9, 14), 9: PSET (10, 14), 9: PSET (11, 14), 9: PSET (12, 14), 8: PSET (5, 15), 8: PSET (6, 15), 115: PSET (7, 15), 115: PSET (8, 15), 114: PSET (9, 15), 115: PSET (10, 15), 115: PSET (11, 15) _
, 114: PSET (12, 15), 8: PSET (5, 16), 8: PSET (6, 16), 115: PSET (7, 16), 115: PSET (8, 16), 114: PSET (9, 16), 115: PSET (10, 16), 115: PSET (11, 16), 114: PSET (12, 16), 8:

DIM char%(129)                  'Set aside enough space to hold the sprite
GET (1, 1)-(16, 16), char%      'Get the sprite into the ball% array

CLS

PAINT (0, 0), 2                 ' Make background
FOR x = 160 TO 175
FOR y = 100 TO 115
PSET (x, y), 0
NEXT y
NEXT x
DIM back%(32001)                'Set aside enough space to hold the sprite
GET (0, 0)-(319, 199), back%    'Get the sprite into the back% array

CLS

charx% = 160: chary% = 100      ' Set default ballx% and bally% coordinates
PUT (0, 0), back%
PUT (charx%, chary%), char%

DO
GOSUB getInput
IF nothingHappened% = 0 THEN GOSUB drawChar
IF exitloop1% = 1 THEN EXIT DO
LOOP

DO
PSET (INT(RND*320), INT(RND*320)), 0
IF INKEY$ = CHR$(27) THEN EXIT DO
LOOP

SLEEP
SYSTEM

getInput:
I$ = INKEY$
IF I$ = "" THEN nothingHappened% = 1: RETURN   ' No button being pressed? DO NOTHING!
PUT (charx%, chary%), char%     ' cover the old char
IF I$ = CHR$(0) + "H" THEN chary% = chary% - 16
IF I$ = CHR$(0) + "P" THEN chary% = chary% + 16
IF I$ = CHR$(0) + "M" THEN charx% = charx% + 16
IF I$ = CHR$(0) + "K" THEN charx% = charx% - 16
IF I$ = " " THEN charx% = 160:    chary% = 100

IF charx% < 0 THEN LET charx% = 0
IF chary% < 4 THEN LET chary% = 4
IF charx% > 304 THEN LET charx% = 304
IF chary% > 180 THEN LET chary% = 180

nothingHappened% = 0
IF I$ = CHR$(27) THEN exitloop1% = 1
RETURN


drawChar:

PUT (charx%, chary%), char%     ' replace the char
LOCATE 1, 1
PRINT charx%; chary%            ' print the char's location

RETURN
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#43
thanks alot, i amde the y of the fill INT(RND*200) instead of 320 and it fills a bit faster, but u have to rpess esc again after its done filling for some stupid reason, can that be fixed
Reply
#44
Yes, put in a counter, ie. i% = i% + 1, then do if i% = 20000 then exit do, or something.

And please make your sig ... smaller. It's enormous..
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#45
wats wrong wit my sig, ill make smaller though, its i think 600x200, its the same one i use for another site, and hows this counter thing work
Reply
#46
You'll just have to figure it out, it's pretty simple.

Your sig covers a third of my screen mate.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#47
i figured out y it kept ending, someone noticed my loop was incapable of looping lol, but im working on fixing it rite now, the counter need not be needed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)