Hi Flemar, welcome to the forums! Ok, first thing I found was that you have a couple of goto commands in there. So far they don't seem to be causing a problem but gotos are considered to be poor programming practise as it jumps from here to there and everywhere, which makes it very hard to follow as projects get larger and makes finding bugs a lot harder. So now that you have had a little expierence with the goto command I recommend that you should use it when there is no alternative. With your code there are heaps of alternatives such as using a do-loop and subroutines. A great alternative to the goto is the gosub command.
Here is your code rearranged using a do-loop and the gosub command. I also added a sync rate in there, most media programs benefit from one.
Rem Project: Dark Basic Pro Project
Rem Created: Thursday, April 21, 2011
Rem ***** Main Source File *****
// turn on sync
sync on : sync rate 60
set display mode 800, 800, 32
load image "D:\Skole\Skole\Eksamen\IT\Grafik\baggrund.png", 1
Load image "D:\Skole\Skole\Eksamen\IT\Grafik\Player3.png", 2
load image "D:\Skole\Skole\Eksamen\IT\Grafik\Politi2.png", 3
Load image "D:\Skole\Skole\Eksamen\IT\Grafik\Busk1.png", 4
Load image "D:\Skole\Skole\Eksamen\IT\Grafik\Busk2.png", 5
Load image "D:\Skole\Skole\Eksamen\IT\Grafik\Busk3.png", 6
Load image "D:\Skole\Skole\Eksamen\IT\Grafik\Busk4.png", 7
Load image "D:\Skole\Skole\Eksamen\IT\Grafik\Busk5.png", 8
Load image "D:\Skole\Skole\Eksamen\IT\Grafik\Øl.png", 9
load sound "D:\Skole\Skole\Eksamen\IT\Lyd\Dunk.wav", 1
load music "D:\Skole\Skole\Eksamen\IT\Lyd\beer song lyrics.mp3", 1
//Play music 1
Playerx = 600
Playery = 700
score = 0
//Control:
// start of loop
do
paste image 1, 0, 0
Sprite 1, 0, 360, 4
Sprite 2, 0, 0, 5
Sprite 3, 470, 578, 6
Sprite 4, 0, 557, 7
Sprite 5, 493, 380, 8
Sprite 6, 402, 0, 8
Sprite 7, Playerx, Playery, 2
if upkey()=1 then Playery = Playery - 1
if downkey()=1 then Playery = Playery + 1
if leftkey()=1 then Playerx = Playerx - 1
if Rightkey()=1 then Playerx = Playerx + 1
if Playerx > 750 then Playerx = 750
if Playerx < 0 then Playerx = 0
if Playery > 750 then Playery = 750
if Playery < 0 then Playery = 0
//Beer spawn
if sprite collision (9,7) then score = score + 1
if sprite collision (9,1) then gosub Bottle
if sprite collision (9,2) then gosub Bottle
if sprite collision (9,3) then gosub Bottle
if sprite collision (9,4) then gosub Bottle
if sprite collision (9,5) then gosub Bottle
if sprite collision (9,6) then gosub Bottle
if sprite collision (9,7) then gosub Bottle
//Point:
hide sprite 6
set text size 30
ink rgb(0,0,0),rgb(0,0,0)
paste sprite 6, 402, 0
text 500, 1, "Bottles Found: " + str$(score)
num1=sprite collision(1,7)
if num1>0 then Play sound 1
num2=sprite collision(2,7)
if num2>0 then Play sound 1
num3=sprite collision(3,7)
if num3>0 then Play sound 1
num4=sprite collision(4,7)
if num4>0 then Play sound 1
num5=sprite collision(5,7)
if num5>0 then Play sound 1
num6=sprite collision(6,7)
if num6>0 then Play sound 1
sync
// end of loop
loop
//goto Control:
// subroutine for beer bottles
Bottle:
Sprite 9, rnd(784), rnd(740), 9
return
So try this and tell me if there is any difference to your original project.
Now for the wall problem. As I don't know what your images look like and their dimensions I can't help you too much but what I can do is demonstrate the concept of stopping at a wall. Here is a small code snippet. Basically, it checks for when the object is out of its bounds and moves it back in. Code is fairly simple.
sync on : sync rate 60
x as integer = 320
y as integer = 240
radius as integer = 40
do
cls
if upkey()=1
dec y, 2
if y < 40 then y = 40
endif
if downkey()=1
inc y, 2
if y > 440 then y = 440
endif
if leftkey()=1
dec x, 2
if x < 40 then x = 40
endif
if rightkey()=1
inc x, 2
if x > 600 then x = 600
endif
text 0, 0, "use arrowkeys to control"
circle x, y, radius
sync
loop
Try to implement the concept of this into your game. Other than that good luck
A clever person solves a problem, a wise person avoids it - Albert Einstein