This repository was archived by the owner on Mar 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgravity.mxml
More file actions
executable file
·73 lines (65 loc) · 7.42 KB
/
gravity.mxml
File metadata and controls
executable file
·73 lines (65 loc) · 7.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
applicationComplete="Gravity.init()"
enterFrame="Gravity.main()">
<fx:Style source="gravity.css"/>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:BorderContainer borderVisible="false" width="100%" height="100%" mouseDown="Interface.click_handler(event)" mouseUp="Interface.click_handler(event)" mouseMove="Interface.mouse_move(event)" backgroundColor="#000000">
<mx:SWFLoader id="view" width="100%" height="100%"/>
<s:Label text="Not to physical scale. Gravitational constant is 1. Particle radius is log of mass. Integration is Θ(n^2) Euler." left="0" top="0" fontStyle="italic" fontFamily="Consolas" fontWeight="bold" fontSize="11" color="white"/>
<s:Label x="0" y="20" text="Click to add particle. Click and drag to specify velocity vector." fontWeight="bold" fontFamily="Consolas" fontStyle="italic" fontSize="11" color="white"/>
<s:Label x="0" y="31" text="Alt + Click creates virtual mass at mousepoint. Move it around to influence other particles. As soon as you unpress Alt key it will disappear." color="white"/>
<s:Label x="0" y="41" text="Ctrl + Click-Drag moves view." color="white"/>
<s:Label x="0" y="51" text="Shift + Click deletes selected object." color="white"/>
</s:BorderContainer>
<s:BorderContainer width="200" height="200" borderVisible="false" backgroundAlpha="0.0" bottom="0" backgroundColor="#EBEBEB" borderColor="#E7E7E7" left="0">
<s:Button x="0" y="178" label="Proto disk (slow start)" click="Interface.generate_proto()"/>
<s:CheckBox x="2" y="160" label="Paths (disables when view moves)" selected="false" id="paths" click="Interface.path_toggle()" color="#FFFFFF"/>
<s:Label id="particle_quantity" x="3" y="149" text="Particles:" color="#FFFFFF"/>
<s:TextInput id="mass" x="37" y="38" fontFamily="Consolas" fontWeight="bold" text="1000" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="96" borderAlpha="0.38"/>
<s:Label x="2" y="39" text="Mass:" color="#FFFFFF"/>
<s:Button x="2" y="53" label="Tiny" height="15" width="60" click="mass.text = String(1)"/>
<s:CheckBox x="145" y="120" label="Autoclearing" selected="true" id="autoclear" color="#FFFFFF"/>
<s:Button x="151" y="135" label="Clear" height="15" width="60" click="Particle.clear()"/>
<s:Button x="2" y="68" label="Small" height="15" width="60" click="mass.text = String(1000)"/>
<s:Button x="2" y="83" label="Medium" height="15" width="60" click="mass.text = String(10000)"/>
<s:Button x="2" y="98" label="Large" height="15" width="60" click="mass.text = String(100000)"/>
<s:Button x="2" y="113" label="Huge" height="15" width="60" click="mass.text = String(1000000)"/>
<s:Button x="2" y="128" label="OMFG" height="15" width="60" click="mass.text = String(10000000)"/>
<s:Label x="4" y="8" color="#0000FF" fontSize="15" id="reality"/>
</s:BorderContainer>
<s:BorderContainer width="200" height="470" borderVisible="false" backgroundAlpha="0.0" bottom="0" backgroundColor="#EBEBEB" borderColor="#E7E7E7" right="0">
<s:Button x="25" y="0" label="<< Slower" click="Interface.slower()"/>
<s:Button x="100" y="0" label="Quicker >>" click="Interface.quicker()"/>
<s:TextInput id="virtual_mass" x="105" y="38" change="Interface.input_change_handler(event)" fontFamily="Consolas" fontWeight="bold" text="1000000" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="96" borderAlpha="0.38"/>
<s:Label x="2" y="39" text="Alt-click mass:" color="#FFFFFF"/>
<s:TextInput id="virtual_radius" x="105" y="53" change="Interface.input_change_handler(event)" fontFamily="Consolas" fontWeight="bold" text="150" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="96" borderAlpha="0.38"/>
<s:Label x="2" y="54" text="Alt-click radius:" color="#FFFFFF"/>
<s:Button x="0" y="81" label="Planet with ring" click="Interface.generate_Saturn()"/>
<s:Button x="0" y="104" label="+low moon" click="Interface.generate_low_moon()"/>
<s:Button x="100" y="104" label="+high moon" click="Interface.generate_high_moon()"/>
<s:Button x="0" y="127" label="+eater" click="Interface.generate_eater_moon()"/>
<s:Button x="100" y="127" label="+EATER" click="Interface.generate_big_eater_moon()"/>
<s:Button x="0" y="155" label="Horseshoe 1" click="Interface.generate_horseshoe1()"/>
<s:Button x="0" y="178" label="Horseshoe 150" click="Interface.generate_horseshoe150()"/>
<s:Button x="0" y="206" label="Spiral galaxy" click="Interface.generate_galaxy()"/>
<s:Label x="2" y="234" text="Number of spirals:" color="#FFFFFF"/>
<s:TextInput id="spiral_count" x="105" y="234" fontFamily="Consolas" fontWeight="bold" text="2" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="25" borderAlpha="0.38"/>
<s:Label x="2" y="254" text="Curvature:" color="#FFFFFF"/>
<s:TextInput id="curvature_count" x="105" y="254" fontFamily="Consolas" fontWeight="bold" text="100" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="25" borderAlpha="0.38"/>
<s:Label x="2" y="274" text="Random:" color="#FFFFFF"/>
<s:TextInput id="random_count" x="105" y="274" fontFamily="Consolas" fontWeight="bold" text="100" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="25" borderAlpha="0.38"/>
<s:Button x="0" y="302" label="Klemperer rosette" click="Interface.generate_rosette()"/>
<s:Label x="2" y="330" text="Number of bodies:" color="#FFFFFF"/>
<s:TextInput id="body_count" x="105" y="330" fontFamily="Consolas" fontWeight="bold" text="3" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="20" borderAlpha="0.38"/>
<s:Button x="0" y="350" label="Hill sphere" click="Interface.generate_hillsphere()"/>
<s:Label x="2" y="378" text="Distance:" color="#FFFFFF"/>
<s:TextInput id="distance" x="105" y="378" fontFamily="Consolas" fontWeight="bold" text="250" paddingLeft="0" paddingTop="0" paddingRight="0" paddingBottom="0" borderVisible="true" fontSize="11" borderColor="#B5B5B5" chromeColor="#FFFFFF" contentBackgroundColor="#2B2B2B" color="#FFFFFF" width="20" borderAlpha="0.38"/>
<s:Button x="0" y="406" label="Solar system" click="Interface.generate_solar()"/>
<s:CheckBox x="2" y="430" label="Rounding orbits" selected="false" id="rounding" color="#FFFFFF"/>
</s:BorderContainer>
</s:Application>