How do I ... 3D Dynamic Starfield?

Get help using Construct 2

Post » Sun May 03, 2015 7:50 pm

OK, so I do not know if I found a bug or it's just something I cannot figure out. Most likely the latter. However I am posting here in the "How do I?" because I believe that there are some create techniques that can be learned from this particular project such as a good example of how to work with your dynamic objects (ships, bullets, anything that you are going to destroy the first static and create more dynamically throughout the game play. It also uses families, teaches a very good technique on using thrusters and a different take on simulating a 3D starfield where the player is always in the middle of the screen.

The CAPX uses the Spaceship plugin which resides right here ->

Theory of operation
The player ship is spawned by and centered on the HUD object (which is a dummy and invisible for this test). The function for crating the players ship takes care of creating all other objects needed as well as setting dynamic properties such as Thruster Level (Rotation Rate), Maximum speed,including acceleration and deceleration as well as adjusting the Exhaust (Particles) to reflect different levels of engines.

Since the player is locked in place the spaceship object is used to move the stars to simulate the player moving. the CreateStars() function creates 60 stars on 3 different layers. You could also just use a family instance variable here but for clarity and teaching sake I just separated them into 3 layers.

When you debug and change the, change the setting for CreatePlayer (line #12), last line, Set PlayerEngineLevel(1-10). This should replace the values (default) in the Stars Spaceship properties and it does not. As a matter of fact, you can tell from the Debug Log that execution stops for some reason in SetPlayerengineLevel() after calling
Code: Select all
debug(Function.Param(0)&" is in valid range")
and before
Code: Select all
debug("Exhaust speed set to "&Exhaust.InitSpeed)

Th same thing is happening with setting the properties of the Exhaust or Exhaust(s) [Family]. They do not change and maintain the initial properties. So everything works (but different star speeds) from the Editor Default Settings. If you set the Max Speed, Acc and Decc of the stars to 0 and then callthe SetPlayerEngineLevel with a value from 1 to 10 it should set the properties. It does not.

So what does not work?
    - Changing the values (Initial Speed & other properties) for the particle object (exhaust)
    - Changing the spaceship object properties (Max speed, Speed, Acc and Decel) for the stars

You can download the CAPX here ->

I'm asking for help to make this system work flawlessly and with maximum performance. After we reach that point I will wrap it up in a beautiful Tutorial package for the community.

Thanks for the help in advance, Chow!

* UPDATED CAPX - 3 May 2015 *
* UPDATED CAPX - 4 May 2015 *

SOLVED (Pretty Much)
I have some issues with the syncing stars after changing values ... but it is working. Please put some more eyes on this and see if you can tell where it's going wrong?
[b]Andrew Donelson[b]
I2TM Labs
[email protected]
Posts: 66
Reputation: 1,136

Return to How do I....?

Who is online

Users browsing this forum: db3344, leena222, mindragon73, Yahoo [Bot] and 18 guests