Author Topic: Auto-Sprite generating  (Read 3153 times)

AjVback

  • Visitor
  • *
  • Posts: 12
    • View Profile
    • Email
Auto-Sprite generating
« on: 2005-05-24, 04:40:01 AM »
Hi,
I was wondering,

Would it be possible, NOT would someone plase do this for me, Would it be possible to write a script which automaticly generates sprites. I was thinking of doing this for my racing game so you dont have to define hundreds of civillian cars and slow the game down. The idea is to randomly generate them and delete them when they pass out of view so you only ever have about 5-10 sprites on the map. They would need to apperar on a certain tyile, though so they didnt apperar on a house.
-Aaron Snoswell

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Auto-Sprite generating
« Reply #1 on: 2005-05-24, 10:19:39 AM »
Yes, it would be possible.  Looking at Gold Yoink code, using:

Code: [Select]
Set oNewSprite = NewSpriteDef
oNewSprite.Name = "Car" & nEnemyNum
Set oNewSprite.rPath = oNewPath
Set oNewSprite.rLayer = oEditLayer
Set oNewSprite.Template = oCacheEnemyTemplate


and the big one
Code: [Select]
oMap.AddSpriteDef HostObj.AsObject(oNewSprite)

You can look at the full code to find out where it gets oNewPath, oEditLayer, etc. from.  Find it here
Edward Dassmesser