well you can't do that in DBC. If I am reading that right (only very basic level C++ experience, so bear with) what you would mean is something to the effect of:
if xpos=xpos
if ypos=ypos
paste image 2,rnd(640),rnd(480)
endif
endif
Here are things I noticed here:
1) == doesn't exist in dbc, its just one = that works for both "set equal to" and "check if equal to". There is no difference (== might work, haven't tried it, but definitely not needed)
2) Images don't work that way. Seems like you would want either to use sprites (in which case you would have something like IF SPRITE X(1)=Sprite X(2) then....) or keep track of each images location separately in variables (such as PlayerX,PlayerY,DotX,DotY). Since I assume you will want multiple Dots, I would definitely suggest using an Array (see DIM command). Paste image is much faster than any kind of sprites, the downside is that you will need to manually clear the screen (which you are doing anyway).
So, an altered version of your main loop (just sorta improvising, you will probably want to tweek it)
REM Establish the array for Dot locations. This will have a max of
REM 10 dots, with 2 coordinates for each
Dim DotsPos(10,2)
PlayerxPos=rnd(640)
PlayeryPos=rnd(480)
Do
cls
if upkey()=1 then PlayeryPos=PlayeryPos-4
if leftkey()=1 then PlayerxPos=PlayerxPos-4
if downkey()=1 then PlayeryPos=PlayeryPos+4
if rightkey()=1 then PlayerxPos=PlayerxPos+4
if PlayerxPos=DotsPos(1,1) AND PlayeryPos=DotsPos(1,2)
DotsPos(1,1)=rnd(640) : DotsPos(1,2)=rnd(480)
endif
Paste Image 1,PlayerxPos,PlayeryPos
paste image 2,rnd(640),rnd(480)
sync
Loop
Hope this helps!
Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose