Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Jul 20, 2019 9:06 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: SSS Not Colliding
PostPosted: Thu Nov 23, 2006 7:18 pm 
Offline

Joined: Fri Oct 06, 2006 9:42 pm
Posts: 16
iv got two simple sprites that wont collide with each other and i cant figure out why.

MakeMap()
dim mask as SuperSpriteBoundsRect
dim block as new SuperSpritePicture(WallTile)
block.SuperSpritePicture(WallTile,true)
MapSurface=new demo

MapSurface.image=block


MapSurface.Position = new TinrocketVector2D(500,300)

SuperSpriteSurface1.Sprites.Append(MapSurface)


Open()
SuperSpriteSurface1.CollisionChecker.Append new SuperSpriteCollisionChecker(me.SuperSpriteSurface1)

SuperSpriteSurface1.CollisionChecker(0).AddGroup("wall")
SuperSpriteSurface1.CollisionChecker(0).AddGroup("ship")



ShipS = new SuperSpritePicture(ship,shipmask,true)


ShipSprite = new SpaceShip
ShipSprite.Image = ShipS
ShipSprite.Position.set(200,200)
ShipSprite.MakeBoundsForImage("ship")

MakeMap()


MapSurface.MakeBoundsForImage("wall")
MapSurface.DebugColor= rgb(0,0,255)
ShipSprite.DebugColor = rgb(200,200,0)
MapSurface.DrawDebugBounds=true
ShipSprite.DrawDebugBounds = true



SuperSpriteSurface1.BackColor = rgb(100,100,100)
SuperSpriteSurface1.Sprites.Append(ShipSprite)

SuperSpriteSurface1.Threaded = true




SuperSpriteSurface1.Run


spaceship-collision
msgbox "BANG"


in the nextframe of spaceship i just have simple code to move a few pixle each frame.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 24, 2006 6:25 am 
Offline

Joined: Fri Sep 30, 2005 11:19 am
Posts: 275
It was a long time ago I used SSS, but I think you have to add the sprites to the CollisionChecker aswell.

_________________
"If you look carefully at my lips, you'll realize that I'm actually saying something else."
Brainswitch Machina - REALStudio/REALbasic
RBScriptExtender - give RBScript power to work with any class


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group