Hi Lee,

There may be something in a PD toolkit but I am not aware of any. Once I wrote 
a screen saver with bouncing disks that bounced off the screen and each other. 
Collision detection was through keeping track of things the disks might hit in 
a table. Check table and update every time a disk was used. It was written in 
C. Here are 2 bits of SBASIC code one for detecting screen colour mode 8 (pore) 
and one for placing a pixel in screen coordinates (peer). Both from an 
excellent guide to SuperBasic by Donald Alcock. A useful book with examples if 
you can get a copy.

Regards

 
100 DEFine FuNction PEER(x,y)
110 LOCal a,p%,q%,shift%
120 a=131072+128*y+2*(x DIV 4)
130 shift%=2^(6-2*(x MOD 4))
140 p%=PEEK(a) DIV shift%
150 q%=PEEK(a+1) DIV shift%
160 RETurn(p%&&1)*8||(p%&&2)*2||(q%&&3)
170 END DEFine
 
100 DEFine PROCedure PORE(x,y,pixel)
110 LOCal a,b%,q%,m%
120 a=131072+128*y+2*(x DIV 4)
130 IF a<131072 OR a>=163840 : RETurn 
140 p%=(pixel&&4) DIV 2||(pixel&&8) DIV 8
150 q%=pixel&&3
160 shift%=2^(6-2*(x MOD 4))
170 m%=~~(3*shift%)
180 POKE a,(PEEK(a)&&m%)||p%*shift%
190 POKE a+1,(PEEK(a+1)&&m%)||q%*shift%
200 END DEFine




 

 

-----Original Message-----
From: Lee Privett <lee.priv...@gmail.com>
To: ql-us...@q-v-d.com
Sent: Thu, 12 May 2011 18:49
Subject: Re: [Ql-Users] screen detection


Weird it may be but unless there is some other sprite software I am not

aware of (DPs I am having problems with), I do not know how to detect

graphic collision without looking at the screen directly, unless there is

another way? I don't know enough m/c to program in only S*Basic



-----Original Message-----

From: ql-users-boun...@lists.q-v-d.com

[mailto:ql-users-boun...@lists.q-v-d.com] On Behalf Of Computer Research

Centrum, Ltd

Sent: 10 May 2011 10:51

To: ql-us...@q-v-d.com

Subject: Re: [Ql-Users] screen detection





>> The Spectrum had PLOT x,y ( I think) for switching on a pixel and the 

>> function POINT x,y for returning a value

>>

>> Obviously the QL has POINT which plots, so PEEK?

>>

>No inbuilt function, although various have been written, e.g. there is 

>one in DIY Toolkit somewhere.



It is weird to use screen as input device.

 

dex _______________________________________________

QL-Users Mailing List

http://www.q-v-d.demon.co.uk/smsqe.htm



_______________________________________________

QL-Users Mailing List

http://www.q-v-d.demon.co.uk/smsqe.htm


 
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to