Qbasicnews.com
February 23, 2020, 07:53:10 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] 2 3
  Print  
Author Topic: Get\Put troubles  (Read 10179 times)
Pyrokid
Wandering Guru
***
Posts: 355



WWW
« on: August 30, 2005, 05:04:31 PM »

Alright its been a while since i programmed last and ive decided on makin a game. it uses 2 maps each the size of the screen. im using screen 12 the 640x480 (i think) and i am using the get statement so that i can get the whole entire screen in one array but for some reason it isnt storing it or wont let me put it on the screen.

heres were i have the problem its in fb
Code:

get (0,0)-(640,480),firstfloor
cls
sleep
put (0,0),firstfloor

its in a sub if that makes a difference
Logged

his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless  effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Anonymous
Guest
« Reply #1 on: August 30, 2005, 05:07:12 PM »

are you doing

Code:
dim as integer firstfloor ( 640 * 480 )


somewhere b4 that?

also you only need to do 0 - 639 and 0 - 479
Logged
Pyrokid
Wandering Guru
***
Posts: 355



WWW
« Reply #2 on: August 30, 2005, 05:13:05 PM »

Code:
dim shared firstfloor(10000000)

i got that at the top
Logged

his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless  effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Anonymous
Guest
« Reply #3 on: August 30, 2005, 05:17:34 PM »

Code:
Screen 12

Dim As Integer firstfloor ( 640 * 480 )

Randomize Timer

For pil = 0 To 100000
  PSet (Int(Rnd * 640), Int(Rnd*480)), Int(Rnd * 16)

Next

Get (0,0)-(639,479),firstfloor

Cls
Sleep

Put (0,0),firstfloor

Sleep


so...
Logged
Pyrokid
Wandering Guru
***
Posts: 355



WWW
« Reply #4 on: August 30, 2005, 05:25:55 PM »

thanks it worked
Logged

his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless  effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Neo
Na_th_an
*****
Posts: 2150



« Reply #5 on: September 04, 2005, 07:58:06 PM »

Quote from: "Pyrokid"
Code:
dim shared firstfloor(10000000)

i got that at the top

I don't see why you need to allocate 38 MB of memory for the image you want to Get... (while 307204 bytes would suffice).
Logged
Pyrokid
Wandering Guru
***
Posts: 355



WWW
« Reply #6 on: September 05, 2005, 05:43:16 PM »

lol i do that just to be safe. im to lazy to add up the number of pixels i want to share
Logged

his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless  effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #7 on: September 05, 2005, 08:35:51 PM »

You'll run out of memory tho, and fast at that rate....  Tongue .... I dimmed a few in FB one time like that and a lil higher and managed "Out of Memory",... (Fun where a few experiments can lead).. Just saying,..  :wink:
Logged

Kevin (x.t.r.GRAPHICS)

axipher
Ancient Guru
****
Posts: 544



« Reply #8 on: November 20, 2005, 11:47:24 PM »

experimenting is fun, i once made a program and it kept creating more sprites and loading a picture of the current screen into the memory and it said out of memry, but kept making sprites, and after a while the computer just shutdwn, when i logged on and chk the log file, it said the DOS file became corrupt, wats up with that, no dmg tho, just shut dwn
Logged
Dr_Davenstein
Na_th_an
*****
Posts: 2052


« Reply #9 on: November 21, 2005, 12:04:51 AM »

I made a slot machine in QB a long time ago. It used bload to display the images. (320x200)x360x360x360 would have been the memory requirements. :lol:
Logged
axipher
Ancient Guru
****
Posts: 544



« Reply #10 on: November 21, 2005, 11:52:58 PM »

for a 16x16 image with empty spaces on sides, would i use simply the following
Code:
DEFINT A-Z

SCREEN 13
CLS
'use PSET to draw the image

'Set aside enough space to hold the sprite
DIM Char%(256)

'Get the sprite into the Char% array
GET (0, 0)-(16, 16), Char%

' Set the sprite to wherever its needed
PUT (x, y), Char%


heres the image, the light blue part is wat i want transparent


hope u can help me out
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #11 on: November 23, 2005, 05:57:09 AM »

In QB, you have to use a graphics library or learning how to use masks if you like GET and PUT.

http://faq.qbasicnews.com/?blast=MaskingAndSprites
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
axipher
Ancient Guru
****
Posts: 544



« Reply #12 on: November 23, 2005, 11:35:55 AM »

thnx for the link, it helped
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #13 on: November 23, 2005, 12:21:51 PM »

Yr welcome Smiley
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
axipher
Ancient Guru
****
Posts: 544



« Reply #14 on: November 24, 2005, 12:36:18 PM »

for a background in screen 13 (320x200) i tried using DIM back% (64000), but when i run it, it says overload or sumtin like that, and continuously redrawing it every time the user presses a numpad key (to move the char) it flickers as it draws...
Logged
Pages: [1] 2 3
  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!