Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange
#1
....So, I'm using some get and put statements to deal with some graphics.


I have a put statement in a DO loop, but it only puts the image everyother time the loop runs... The other times it deletes the image from the screen.

How can you solver this?


the image should just be being displayed over its self over and over.
Reply
#2
may i see some code? it may help
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#3
Luckily Im just starting the game im working on.


Its about mid way... I commented the line that the issue is with saying that it is the one with the issue

Code:
DECLARE SUB drawground (drawgroundflag)
DECLARE SUB drawskater (skaterxpos, skaterypos, olliestage, flipstage, rightshoe(), leftshoe())
DECLARE SUB loadmem (rightshoe(), leftshoe())
REM VARIABLE DICTIONARY
REM i......................generic for loop counter
REM drawgroundflag.........a flag for the drawground sub program, but
REM                        the value needs to be retained so it needs
REM                        to be here too.
REM rightshoe..............array for the right shoe
REM leftshoe...............array for the left shoe

SCREEN 7

drawgroundflag = 0
DIM rightshoe(222)
DIM leftshoe(222)

CALL loadmem(rightshoe(), leftshoe())  '*NOTE* This does clear the screen


DO
  CALL drawskater(skaterxpos, skaterypos, olliestage, flipstage, rightshoe(), leftshoe())
  CALL drawground(drawgroundflag)
  SLEEP
LOOP

SUB drawground (drawgroundflag)
REM VARIABLE DICTIONARY
REM i...............generic for loop counter
REM groundcolour....constant for ground colour
REM groundlines.....constant for colour of ground texture(lines)
REM drawgroundflag..tells where to print the lines. To give the appearence
REM                 of the ground moving by.

CONST groundcolour = 7
CONST groundlines = 6

LINE (0, 150)-(320, 200), groundcolour, BF   ' Main box for ground

IF drawgroundflag = 0 THEN
  FOR i = 1 TO 20
    LINE (i * 20, 150)-((i * 20) - 20, 320), groundlines
  NEXT i
  drawgroundflag = 1
ELSE
  FOR i = 1 TO 20
    LINE (i * 20 - 10, 150)-((i * 20) - 20 - 10, 320), groundlines
  NEXT i
  drawgroundflag = 0
END IF

END SUB

SUB drawskater (skaterxpos, skaterypos, olliestage, flipstage, rightshoe(), leftshoe())

REM VARIABLE DICTIONARY


LINE (20, 145)-(25, 145), 5 'sole of right shoe
LINE (34, 145)-(39, 145), 5 'sole of left shoe

PUT (34, 142), leftshoe     '%$*(&$(*&#$(*$  LINE WITH ISSUE  ****LOOOK HERE ******************
PUT (20, 142), rightshoe   '%$*(&$(*&#$(*$  LINE WITH ISSUE  ********LOOOOOOK HEEEEERR************

FOR i = 0 TO 3                       '|Left
  LINE (37 - i, 141)-(37 - i, 134)   '|Lower
NEXT i                               '|Leg

FOR i = 0 TO 3                       '|Right
  LINE (25 - i, 141)-(25 - i, 134)   '|Lower
NEXT i                               '|Leg

FOR i = 0 TO 3
  LINE (37 - i, 134)-(34 - i, 124)
NEXT i


FOR i = 0 TO 3                       '|Right
  LINE (25 - i, 134)-(28 - i, 124)   '|Upper
NEXT i                               '|Leg



END SUB

SUB loadmem (rightshoe(), leftshoe())

REM VARIABLE DICTIONARY
REM shoecolour...............the colour of the shoe
REM i........................generic for loop counter
REM i2.......................generic for loop counter

CONST shoecolour = 4
                                    
FOR i2 = 0 TO 2                    '|
  FOR i = 20 + i2 TO 25            '|   draw
    PSET (i, 144 - i2), shoecolour '|   right
  NEXT i                           '|   shoe
NEXT i2                            '|

GET (20, 144)-(25, 142), rightshoe

FOR i2 = 0 TO 2                     '|
  FOR i = 34 TO 39 - i2             '|  draw
    PSET (i, 144 - i2), shoecolour  '|  left
  NEXT i                            '|  shoe
NEXT i2                             '|

GET (34, 144)-(39, 142), leftshoe




CLS
END SUB
Reply
#4
PUT (0,0),image

the default put, above, does XOR. Try this

PUT (0,0),PSET
Reply
#5
excellent! Thank you very much
Reply
#6
SuperPut!!!!
Big Grin
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#7
where is superPUT rel, i didnt see it in the homepage faq?
url]http://qb45.think-new.com[/url]
Reply
#8
http://www.phatcode.net/other/superput.zip
Reply
#9
This FAQ has it too..

http://faq.qbasicnews.com/


Plus other stuff..
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
#10
Quote:PUT (0,0),image

the default put, above, does XOR. Try this

PUT (0,0),PSET

And just in case you're not quite clear what Pyrodap means about this:

The default setting will XOR the sprite with the existing colours on screen. When you put the sprite on top of it again, the sprite is re-XORed on top, and so reverses what was done before. This allows you to put a sprite on top of an existing image, then by using the same command, the sprite can be erased, yet keeping the background image intact.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)