PDA

View Full Version : Higher Levels = More Spawns


Saneron
10-08-2008, 06:40 PM
So, I'm making a game, and i want to know how to program a method, that, for example:

Level 1: 10 knights will spawn
Level 2: 20 knights will spawn
Level 3: 30 knights will spawn, and 10 Mounted Knights

I already have 1 of each made, but i want to know if there is a way to continuously create copies of the same object, that share all of the same stats.

Or, if there is a way to make an array of knights or something, that only spawn if you are in the correct level or less, for example:

Level 1: spawn array of 10 knights
Level 2: spawn another array of 10 knights, with the original array of knights as well

and so on, any help will do. :D

DickBaldwin
10-08-2008, 07:21 PM
I already have 1 of each made, but i want to know if there is a way to continuously create copies of the same object, that share all of the same stats.

Alice 2.0 and 2.2 cannot create new objects at runtime. This capability will probably be available in Alice 3.0.

Until then, you must create every object needed by a world during program development. As the number of knights is not excessive, you should be able to create all of them and make them invisible during program development, then make them become visible when needed at runtime.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free Scratch tutorials: http://www.dickbaldwin.com/tocHomeSchool.htm
Free Java/C#, etc. tutorials: http://www.dickbaldwin.com/toc.htm

Saneron
10-08-2008, 11:20 PM
wouldn't that create unnecessary processes? for example, having like, 400 objects load, but only 10 visible in the beggining?

It is however, the best option i have, so, I'll take it.