Qbasicnews.com
March 29, 2020, 08:39:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Strange  (Read 2617 times)
bonfire89
Member
*
Posts: 25


« on: March 14, 2004, 04:23:51 PM »

....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.
Logged
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #1 on: March 14, 2004, 04:33:50 PM »

may i see some code? it may help
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
bonfire89
Member
*
Posts: 25


« Reply #2 on: March 14, 2004, 04:49:54 PM »

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

Logged
Pyrodap
Senior Member
**
Posts: 166



« Reply #3 on: March 14, 2004, 05:25:35 PM »

PUT (0,0),image

the default put, above, does XOR. Try this

PUT (0,0),PSET
Logged
bonfire89
Member
*
Posts: 25


« Reply #4 on: March 14, 2004, 05:48:26 PM »

excellent! Thank you very much
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #5 on: March 15, 2004, 03:01:05 AM »

SuperPut!!!!
 Cheesy
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
momoguru
Forum Regular
**
Posts: 131



« Reply #6 on: March 15, 2004, 07:20:04 PM »

where is superPUT rel, i didnt see it in the homepage faq?
Logged

url]http://qb45.think-new.com[/url]
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #7 on: March 15, 2004, 07:24:32 PM »

http://www.phatcode.net/other/superput.zip
Logged
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #8 on: March 16, 2004, 01:04:06 AM »

This FAQ has it too..

http://faq.qbasicnews.com/


Plus other stuff..
Logged

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.
KiZ
__/--\__
*****
Posts: 2879


WWW
« Reply #9 on: March 16, 2004, 07:31:32 AM »

Quote from: "Pyrodap"
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.
Logged
bonfire89
Member
*
Posts: 25


« Reply #10 on: March 16, 2004, 02:57:33 PM »

Thank you all!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!