Page 1 of 1

spawning random actors

Posted: Fri Oct 18, 2013 11:40 pm
by Phantom Ppepper
Hey iforce2d,

I've been beating my head on the desk for several hours now trying to figure out how to spawn actors to my box2d world (created with RUBE, of course).

I'm trying to make something similar to the classic "Astroides" game

Re: spawning random actors

Posted: Sat Oct 19, 2013 1:44 am
by iforce2d
What is the question? To give us something to work with, you really need to say:
- what you want to do (check)
- what you've tried so far
- what went wrong
Without this information people might write a post suggesting to try something you've already tried, which wastes their time and yours.

Often the operating system, programming language and SDK/framework can be relevant too, so it wouldn't hurt to mention what environment you're dealing with. Some further definition of what you mean by 'actor' would be helpful too.

Re: spawning random actors

Posted: Sat Oct 19, 2013 2:43 am
by Phantom Ppepper
Oh, sorry for the vagueness - :oops:



After several concussions, I am close to scrapping the idea all together. The thought was to create a scene where rocks would generate "spawn" just to the right of the screen and disappear once off the screen after making contact with a sensor, for memory conservation.
Screen Shot 2013-10-18 at 9.04.48 PM.png
Screen Shot 2013-10-18 at 9.04.48 PM.png (25.21 KiB) Viewed 13341 times
The player is on a prismatic joint that moves on the Y axis via accelerometer, and the sole purpose of the game is to avoid the rocks for as long as possible, which are kinematic bodies traveling at a constant speed linearVelocity(-5,0).

But I believe using RUBE to create actual LEVELS that progressively get harder instead might be quite easier to develop and more fun for the end-user in the end.

-using RUBE and Cocos2D Loader with recent updates
-Cocos2d/Box2D for iOS Development via XCODE, latest versions

Thanks for your time and work.

Re: spawning random actors

Posted: Mon Oct 21, 2013 2:54 pm
by iforce2d
Obviously RUBE is not able to make an endless scene, but what you could do is make sections of level, and load those sections in dynamically as the view scrolled along. Or, if the levels do actually reach a conclusion/goal every now and then, you could set up the whole level from those sections just once at the beginning. Another option might be to take sections as they go off the screen, and move them to the front of the river again. In any of these cases, the sections would have to be made so that they line up at the edges correctly.

This is not really the strong point of a scene editor though, as 'level editor' and 'endless level' don't go together too well :D It really depends on your program to do something clever after loading.

Re: spawning random actors

Posted: Wed Oct 23, 2013 7:35 pm
by Phantom Ppepper
Ah, I see. Thanks!