Qbasicnews.com
April 05, 2020, 12:20:38 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: Just wondering some stuff on Pixels  (Read 3408 times)
SnakeZ
Member
*
Posts: 37


« on: January 30, 2006, 05:08:34 PM »

Hey guys, remember me. I have been off a while. So whats up. I just wanted to once again thank everyone who had helped me out last year when i was doing my school prjoect.

Anyhow, i have delve into learning Q-Basic a bit deeper, and lately i have been learning about pixels. Now i was wondering if anyone here could help me get more than 1 pixel on the screen. Is this even possible, i really don't know.
Logged

ill Gates time is almost up.... i am taking over
thegrogen
Ancient QBer
****
Posts: 444



« Reply #1 on: January 30, 2006, 06:01:31 PM »

Try running this:

Code:

Screen 13
Cls

do
    for loops = 1 to 1000
         pset (rnd(1)*320, rnd(1)*200), rnd(1)*256
    next loops
loop while inkey$ = ""
Logged

.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Dio
I hold this place together
*****
Posts: 874



« Reply #2 on: January 31, 2006, 04:25:49 AM »

Code:
screen 13
PSET (100,100)
PSET (102,100)


it feels nice to help.
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #3 on: January 31, 2006, 08:03:25 AM »

He's talking about getting sprites, not plotting them Tongue

Take a glance in the QB help file at the GET command:

http://qbasicnews.com/qboho/qckadvr.ggx.shtml

If you are working in mode 13h (SCREEN 13) you should remember that the array dimmension required if you are using integers is ROUND UP[(width * height)/2] + 1, i.e. for a 16x16 sprite you need to DIM an array this way:

Code:
Dim MySprite% (129)


Then read those FAQ entries:

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

It should get you started Smiley
Logged

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



« Reply #4 on: January 31, 2006, 09:02:36 AM »

Quote
get more than 1 pixel on the screen


its not clear what he means, this is an ambiguous statement.
Logged

EVEN MEN OF STEEL RUST.
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #5 on: January 31, 2006, 10:21:50 AM »

I think that it's quite obvious that if a guy knows how to plot 1 pixel on the screen he knows how to plot two Cheesy or three.

But I agree, it's a bit ambiguous.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Dio
I hold this place together
*****
Posts: 874



« Reply #6 on: January 31, 2006, 05:48:00 PM »

Quote from: "na_th_an"
He's talking about getting sprites, not plotting them Tongue


i had a feeling...

maybe he means:

FB
Code:
dim x(1000)
dim y(1000)
dim ox(1000)
dim oy(1000)
screen 13,,,1
i = -1
do
  i = i+1:y(i) = i
loop until i = 199

do
for i = 0 to 199
  oy(i) = y(i)
  ox(i) = x(i)
  x(i) = x(i) + int(rnd*6)
  y(i) = y(i) + int(rnd*3)-1:if y(i) > 199 then y(i) = y(i) - 200
  if y(i) < 0 then y(i) = y(i) +200
  if x(i) > 319 then x(i) = x(i) - 320
  pset (ox(i),oy(i)),0
  pset (x(i),y(i))
next
for ii = 0 to 10000000:next
loop
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #7 on: February 01, 2006, 09:28:12 AM »

Maybe Cheesy In fact, it's very possible.

We'll never know if this guy doesn't post back again Cheesy
Logged

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



WWW
« Reply #8 on: February 01, 2006, 11:46:32 AM »

Dio, he posted this in the QB Programming Help section, so FB code will probably be useless to him.
Logged
Z!re
*/-\*
*****
Posts: 4599


« Reply #9 on: February 01, 2006, 03:45:40 PM »

Quote from: "Dio"
Quote from: "na_th_an"
He's talking about getting sprites, not plotting them Tongue


i had a feeling...

maybe he means:

FB
Code:
dim x(1000)
dim y(1000)
dim ox(1000)
dim oy(1000)
screen 13,,,1
i = -1
do
  i = i+1:y(i) = i
loop until i = 199

do
for i = 0 to 199
  oy(i) = y(i)
  ox(i) = x(i)
  x(i) = x(i) + int(rnd*6)
  y(i) = y(i) + int(rnd*3)-1:if y(i) > 199 then y(i) = y(i) - 200
  if y(i) < 0 then y(i) = y(i) +200
  if x(i) > 319 then x(i) = x(i) - 320
  pset (ox(i),oy(i)),0
  pset (x(i),y(i))
next
for ii = 0 to 10000000:next
loop
WHAT THE F....
Is that a FOR/NEXT delay!?
You evil heathen! Get out of here! Go away!

Kill him! Cheesy
Logged
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #10 on: February 01, 2006, 04:45:19 PM »

For, next delay?!!?!?!?!?!

 Shocked

 Tar and Feathers! Tar and Feathers!
Logged

Kevin (x.t.r.GRAPHICS)

Dio
I hold this place together
*****
Posts: 874



« Reply #11 on: February 01, 2006, 05:33:09 PM »

no no!! i could of done a real time delay! im just lazy and wanted a quick way to do it!!! here:

Code:
1:stimer = timer
for i = 0 to 100000000
    if timer > stimer +1 then ii = i:exit for
    if timer < stimer then stimer = 86400 - stimer: stimer = 0 - stimer
next :if ii = 1 then goto 1


see?!? SEE!!?!?!?!11//

anyways,


Quote from: "Kylemc"
Dio, he posted this in the QB Programming Help section, so FB code will probably be useless to him.


i know, i was posting the code for you guys.
so you could help him. sheesh.
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
thegrogen
Ancient QBer
****
Posts: 444



« Reply #12 on: February 02, 2006, 12:54:11 AM »

Quote from: "Dio"
no no!! i could of done a real time delay! im just lazy and wanted a quick way to do it!!! here:

Code:
1:stimer = timer
for i = 0 to 100000000

    if timer > stimer +1 then ii = i:exit for
    if timer < stimer then stimer = 86400 - stimer: stimer = 0 - stimer
next :if ii = 1 then goto 1




That is without a doubt the weirdest misuse of GOTO I've ever seen...

Here's what it should be:
Code:

dim t as integer
t = timer
while ((timer-t) < 5000) : wend ' five seconds


Or, better yet:

Code:

'Qb
sleep 5

'FB
sleep 5000
Logged

.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Dio
I hold this place together
*****
Posts: 874



« Reply #13 on: February 02, 2006, 05:23:32 AM »

Hey, you know what?




FANTASTIC.


honestly. i nearly fell out of my chair when i read you post.
and to show you how much i really care, i just sent you a picture of a giant crap i just took. 'cause that's just how much i care... a giant crap load worth.
but thanks for the help anyway.  Smiley
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Rattrapmax6
__/--\__
*****
Posts: 2577



WWW
« Reply #14 on: February 02, 2006, 02:10:10 PM »

Well,. bad programming in a noob forum can cause for someone learing to program the wrong way.... and FOR.. NEXT delays are bad,. very, very, bad... :lol:
Logged

Kevin (x.t.r.GRAPHICS)

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!