Object Creation - NoodleExtensionsCommunity/How-to-Noodle GitHub Wiki

Object spawners

You probably want to make some epic wall maps or interesting note effects using this, so let's start.

First let's look at the structure of it:

for (let i = 0; i <= z; i++) {
	let x = Random(-25, 25)
	let y = Random(-20, 30)
	walls.push(
		{
			"_time": (200 + (i / 30)),
			"_lineIndex": 0,
			"_type": 1,
			"_duration": 5,
			"_width": 0,
			"_customData": {
				_track: "stars",
				_color: [255, 255, 255, 10],
				_fake: true,
				_interactable: false,
				_scale: [0.3, 0.3, 0.3],
				_animation: {
					_dissolve: [0, 0], [1, 0.1], [1, 0.9], [0, 1](/NoodleExtensionsCommunity/How-to-Noodle/wiki/0,-0],-[1,-0.1],-[1,-0.9],-[0,-1),
					_definitePosition: [x, y, 80, 0], [x, y, Random(-100, -10), 1](/NoodleExtensionsCommunity/How-to-Noodle/wiki/x,-y,-80,-0],-[x,-y,-Random(-100,--10),-1),
					_localRotation: [Random(0, 360), Random(0, 360), Random(0, 360), 0], [0, 0, 0, 1](/NoodleExtensionsCommunity/How-to-Noodle/wiki/Random(0,-360),-Random(0,-360),-Random(0,-360),-0],-[0,-0,-0,-1)
				}
			}
		}
	);
}

Let's explain the parts:

  • for loop: The for loop is in there to run the pushing part for walls z number of times. If you don't know how a for loop works, I suggest you read the guide to for loops.

  • let x/y: Just defining variables for later use.

  • walls.push( { } ): The part where it pushes/writes the JSON under it to _obstacles in the noodle difficulty file.

  • JSON: The JSON part until _track is just creating the obstacle, to read more about customData for all objects go here.

  • _animation: Here is where you can animate the object over it's lifetime, more about single object animation can be found on this page.

More examples

Menacing notes

for (let i = 0; i < 500; i++) {
	let x = Random(-20, 20)
	let y = Random(0, 20)
	notes.push(
		{
			"_time" : (0 + i / 20),
			"_lineIndex" : 1,
			"_lineLayer" : 0,
			"_type" : 0,
			"_cutDirection" : 8,
			"_customData": {
				_track: "spookyNotes",
				_color: [Random(0, 1), Random(0, 1), Random(0, 1)], 
				_noteJumpStartBeatOffset: 20,
				_animation: {
                    _dissolve: [0, 0](/NoodleExtensionsCommunity/How-to-Noodle/wiki/0,-0),
					_localRotation: [Random(0, 180), Random(0, 180), Random(0, 180), 0], [0, 0, 0, 1](/NoodleExtensionsCommunity/How-to-Noodle/wiki/Random(0,-180),-Random(0,-180),-Random(0,-180),-0],-[0,-0,-0,-1),
					_definitePosition: [x, y, 60, 0], [x, y, -10, 1](/NoodleExtensionsCommunity/How-to-Noodle/wiki/x,-y,-60,-0],-[x,-y,--10,-1)
				}
			}
		}
	);
}

What even is noodling

for (let i = 0; i < 500; i++) {
	notes.push(
		{
			"_time" : (20 + i / 20),
			"_lineIndex" : 1,
			"_lineLayer" : 0,
			"_type" : 0,
			"_cutDirection" : 8,
			"_customData": {
				_track: "yes",
				_color: [Random(0, 1), Random(0, 1), Random(0, 1)], 
				_animation: {
					_localRotation: [Random(0, 180), Random(0, 180), Random(0, 180), 0], [0, 0, 0, 1](/NoodleExtensionsCommunity/How-to-Noodle/wiki/Random(0,-180),-Random(0,-180),-Random(0,-180),-0],-[0,-0,-0,-1),
					_definitePosition: [Random(-40, 40), Random(-10, 30), Random(5, 40), 0], [Random(-40, 40), Random(-10, 30), Random(5, 40), 1](/NoodleExtensionsCommunity/How-to-Noodle/wiki/Random(-40,-40),-Random(-10,-30),-Random(5,-40),-0],-[Random(-40,-40),-Random(-10,-30),-Random(5,-40),-1)
				}
			}
		}
	);
}

Well have fun making some crazy art maps!