village update 3( large pics)

Miscellaneous Forums/Blitz Showcase/village update 3( large pics)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

hmm. well, as you are still a noob(at least you can model and do textures), you probably don't know of the evil problems of the collision system ;) .

1)Collisions when you don't want to ie initial positioning of object

2)only sphere-stuff collisions

3)no "do nothing, just detect" collisions

4)no moving polygon collisions ie. sphere-polygon with the polygon moving.

anywho, the blitz collision is GREAT. fast and easy to setup. its just these evil minor problems. So, I would recommend the entitydistance function. it's not hard to use at all.

I just decided to code up an example cause I was a little bored.
;by bot builder

Type bonus
 Field mesh, radius, typ$, info
End Type

Dim keys_had(100)

Function updatebonuses()
 For b.bonus = Each bonus

  Select b\typ$
  Case "coin"
   TurnEntity b\mesh,0,1,0
  Case "key "
   TurnEntity b\mesh,0,1.5,0
   PositionEntity b\mesh,EntityX(b\mesh,1),EntityY(b\mesh,1)+Sin((MilliSecs() Mod 360)*2)*.5,EntityZ(b\mesh,1) ;give it a bouncey motion tweak the 2 and the .5 for different rates/amplitudes
  End Select

  If EntityDistance(player,b\mesh)<b\radius+player_radius Then

   FreeEntity b\mesh		;you could just hideentity
   Delete b.bonus

   Select b\typ$
   Case "coin"
    coin_count=coin_count+1 ;global variable
   Case "key "
    keys_had(keys_count)=info	;An array of the keys had stretching from 0 to key_count-1. The keys could be somthing like 1=red 2=green etc.
    key_count=key_count+1 ;global variable
   Case "ammo"
    player_ammo=player_ammo+info ;player ammo is a global variable. info holds the amount of ammo given.
   End Select
  EndIf
 Next
End Function