# Trails 2.0

• ### Question

• Thanks to everyone's input, ive gotten a code that makes a trail and moves swiftly and everything I wanted. The only problem now is that I need something to pop up if the player hits their own trail or hits the wall..I just want this in a simple way but so it gets the job done.  Just some code to add on to my original code. Not a whole different code. It would help a lot!! Thanks!
```GraphicsWindow.BackgroundColor= "Black"
GraphicsWindow.Height="900"
GraphicsWindow.Width="900"
GraphicsWindow.BrushColor= colour
GraphicsWindow.PenColor= "White"
x=0
y=0
Moving= "true"
Start:
If (Moving="true") Then
X= x+delX
Y= y+delY
GraphicsWindow.TextInput=MoveCycle
Shapes.Move(player,x,y)
EndIf
w = 15
h = 40
GraphicsWindow.BrushColor= colour
GraphicsWindow.FillEllipse(x+15/2-4, y+40/2-4, 12, 12)
Program.Delay(100)
Goto Start
Sub MoveCycle
key=GraphicsWindow.LastKey

If (key="D") Then
delX= 25
delY= 0
Shapes.Rotate(player,90)
ElseIf (key= "A") Then
delX= -25
delY= 0
Shapes.Rotate(player,90)
ElseIf (key="S") Then
delY= 25
delX= 0
Shapes.Rotate(player,0)
ElseIf (key="W") Then
delY= -25
delX= 0
Shapes.Rotate(player,0)
EndIf
EndSub```

Thursday, November 22, 2012 7:53 PM

`If (Moving="true") Then  X= x+delX  Y= y+delY  GraphicsWindow.TextInput=MoveCycle  Shapes.Move(player,x,y)  If (GraphicsWindow.GetPixel(x+15/2+2,y+40/2+2) = "#FF0000") Then '"#FF0000" is Red if your blobs are colour = "Red"    Sound.PlayClickAndWait()  EndIfEndIf`
`If (GraphicsWindow.GetPixel(x+15/2+2,y+40/2+2) <> "#000000") Then`