| Type TBricks Extends TGameObject Function Create:TBricks(Image:TImage,xstart:Int,ystart:Int) Local B:TBricks=New TBricks CreateObject(B,Image,xstart,ystart) Return B End Function Method UpdateSelf() 'do nothing End Method EndType |
| Function CreateBricks() For Local x:Int=0 To 15 For Local y:Int=0 To 5 TBricks.Create(Bricks,50+x*36,50+y*22) Next Next End Function |
| Global Bricks:TImage=LoadAnimImage(URL+"tiles.png",32,20,0,5) CreateBricks() |
![]() |
| Method CheckCollision() SetScale XScale, YScale SetRotation Rotation If CollideImage(Image,X,Y,0,PLAYER_LAYER,0) YSpeed=-YSpeed EndIf For Local b:TBricks=EachIn GameObjectList If ImagesCollide2(Image,X,Y,0,Rotation,XScale,YScale, b.Image, b.X, b.Y, 0, 0, 1.0, 1.0) ListRemove(GameObjectList,b) YSpeed=-YSpeed Exit EndIf Next End Method |
![]() |