saman typen kosketustarkastus
saman typen kosketustarkastus
Eli tuollainen ongelma. Tulee mavia kun käytän setupcollisionia. Eli haluaisin että nuo ei voisi olla samassa kohdassa.
Re: saman typen kosketustarkastus
Code: Select all
For e.bots = Each bots
If e<>newbot Then
setupcollision e\obj,newbot\obj,1,1,2
setupcollision newbot\obj,e\obj,1,1,2
EndIf
Next e
EDIT:
Code: Select all
SCREEN 800,600
Type BOTS
Field speed
Field hp
Field obj
EndType
guy=LoadObject("media\guy.bmp",32)
ShowObject guy,OFF
Repeat
luo+1
If luo>2
luo=0
newbot.BotS= New(BotS)
newBot\obj=CloneObject(guy)
PositionObject newBot\obj,Rand(-100,100),Rand(-100,100)
RotateObject newbot\obj,Rand(0,360)
newbot\hp=Rand(300,500)
newbot\speed=Rand(3,5)
For e.bots = Each bots
If e<>newbot Then
SetupCollision e\obj,newbot\obj,1,1,2
SetupCollision newbot\obj,e\obj,1,1,2
EndIf
Next e
EndIf
For iBot.BotS= Each BotS
ibot\hp-1
MoveObject ibot\obj,ibot\speed
If ibot\hp<1 Then
DeleteObject ibot\obj
Delete ibot
EndIf
Next ibot
DrawScreen
Forever
Sumu Games: Sam, Ur eye!