User Tools

Site Tools


en:examples:spawners:spawning_random_objects

Spawning Random Objects

Assets

Code

orxObject_CreateFromConfig("CannonObject");

Config

[RedBulletObject]
Graphic  = RedBulletGraphic
Speed    = (300, -15, 0) ~ (300, 15, 0) ;each bullet goes right with variable height.
LifeTime = 2.0
 
[RedBulletGraphic]
Texture = spawner-bullet.png
 
[PlusBulletObject]
Graphic  = PlusBulletGraphic
Speed    = (300, -15, 0) ~ (300, 15, 0) 
LifeTime = 2.0
 
[PlusBulletGraphic]
Texture = plus.png
 
[BoxBulletObject]
Graphic  = BoxBulletGraphic
Speed    = (300, -15, 0) ~ (300, 15, 0) 
LifeTime = 2.0
 
[BoxBulletGraphic]
Texture = box.png
 
 
[CannonObject]
Graphic  = CannonGraphic
Position = (100, 100, 0)
Scale    = 5
Spawner  = CannonSpawner
 
[CannonGraphic]
Texture = spawner-gun.png
 
[CannonSpawner]
Object        = RedBulletObject # PlusBulletObject # BoxBulletObject ;here is the point. A random chosen spawn.
WaveSize      = 1
WaveDelay     = 0.2
ActiveObject  = 10
Position      = (10, -1, 0)

en/examples/spawners/spawning_random_objects.txt · Last modified: 2018/02/14 00:47 (6 years ago) by 127.0.0.1