Posts: 25
Threads: 3
Joined: Jan 2004
....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.
Posts: 2,765
Threads: 138
Joined: Nov 2002
may i see some code? it may help
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 25
Threads: 3
Joined: Jan 2004
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
Posts: 144
Threads: 17
Joined: Jan 2004
PUT (0,0),image
the default put, above, does XOR. Try this
PUT (0,0),PSET
Posts: 25
Threads: 3
Joined: Jan 2004
excellent! Thank you very much
Posts: 3,288
Threads: 167
Joined: Nov 2001
SuperPut!!!!
Posts: 131
Threads: 16
Joined: Mar 2003
where is superPUT rel, i didnt see it in the homepage faq?
url]http://qb45.think-new.com[/url]
Posts: 1,752
Threads: 21
Joined: Jun 2002
Posts: 3,368
Threads: 195
Joined: Jan 2003
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.
Posts: 2,771
Threads: 96
Joined: Oct 2003
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.
|