Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
random size and rotation

coa
Registered User
Quote
2022-07-29 17:01:50

I was adding random size and rotation for astreroids in my game Space Frontier and thought i share the script i made maybe someone will find it useful

I needed random rotation also so they all would rotate in diffrent directions

if you use it you must put it before you clone the original node and change steriod1 in the script to your original node name

st = ccbGetSceneNodeFromName("steroid1");

x = Math.floor((Math.random() * 360) + 1);
y = Math.floor((Math.random() * 360) + 1);
z = Math.floor((Math.random() * 360) + 1);

scale = Math.floor((Math.random() * 30) + 5);



ccbSetSceneNodeProperty(st, "Rotation", x, y, z);
ccbSetSceneNodeProperty(st, "Scale", scale, scale, scale);



bulletchain
Registered User
Quote
2022-07-31 02:09:20

wow


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact