@@ -28,30 +28,45 @@ var d = new Date(),
2828 m = ( d . getMinutes ( ) < 10 ?'0' :'' ) + d . getMinutes ( ) ;
2929var printedTime = h + ':' + m ;
3030
31+ introDateTime = [
32+ " " ,
33+ printedTime + ", July 23rd, 2053" ,
34+ "Somewhere outside of Pyramid City, Europa"
35+ ] ;
36+
3137content = [
3238 " " ,
3339 "In the beginning, there were no beginnings." ,
3440 "There were no need for them." ,
3541 "But somewhere between then and now," ,
3642 "people started wondering..." ,
43+ " " ,
3744 "Who am I?" ,
3845 "Where do I come from?" ,
39- "Where am I going? " ,
40- "" ,
41- printedTime + ", July 23rd, 2053" ,
42- "Somewhere outside of Pyramid City, Europa" ,
46+ "Where am I going? "
4347] ;
48+
49+
4450getConspiracy ( ) ;
51+
4552function getConspiracy ( ) {
4653 jQuery . getJSON ( "http://emcradio.com/api/paragraph/conspiracy?_format=api_json" , function ( conspiracyObj ) {
47- // conspiracyToPrint = conspiracyObj.data[0].attributes.field_conspiracy[0].value;
54+ conspiracyToPrint = conspiracyObj . data [ 0 ] . attributes . field_conspiracy [ 0 ] . value ;
4855 } ) ;
4956}
5057
51- var text2 ;
58+ var dateTime ;
5259var index = 0 ;
5360var line = '' ;
61+
62+ var introText ;
63+ var line2 = [ ] ;
64+ var wordIndex = 0 ;
65+ var lineIndex = 0 ;
66+ var wordDelay = 140 ;
67+ var lineDelay = 1400 ;
5468var grd ;
69+ var timeoutID ;
5570
5671// The Google WebFont Loader will look for this object, so create it before loading the script.
5772WebFontConfig = {
@@ -72,7 +87,9 @@ WebFontConfig = {
7287playState [ 0 ] = {
7388
7489 preload : function ( ) {
75- game . load . image ( 'arrow' , '/images/thisway.png' ) ; // Load the Google WebFont Loader script
90+ game . load . image ( 'arrow' , '/images/thisway.png' ) ;
91+
92+ // Load the Google WebFont Loader script
7693 game . load . script ( 'webfont' , '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js' ) ;
7794 } ,
7895 create : function ( ) {
@@ -89,28 +106,37 @@ playState[0] = {
89106 cursors = game . input . keyboard . createCursorKeys ( ) ;
90107
91108
92- text2 = game . add . text ( ) ;
109+ dateTime = game . add . text ( ) ;
110+ dateTime . backgroundColor = 'black' ;
111+ dateTime . font = 'Roboto' ;
112+ dateTime . fontSize = 14 ;
113+ dateTime . fontWeight = 400 ;
114+ dateTime . fill = '#FFDD07' ;
115+ dateTime . align = 'left' ;
116+
93117
94- text2 . font = 'Roboto' ;
95- text2 . fontSize = 32 ;
96- text2 . fontWeight = 700 ;
118+ nextLine ( ) ;
119+ introText = game . add . text ( ) ;
120+ introText . font = 'Roboto' ;
121+ introText . fontSize = 32 ;
122+ introText . fontWeight = 700 ;
97123
98124 // x0, y0 - x1, y1
99- grd = text2 . context . createLinearGradient ( 0 , 0 , 0 , 100 ) ;
125+ grd = introText . context . createLinearGradient ( 0 , 0 , 0 , 500 ) ;
100126 grd . addColorStop ( 0 , '#099' ) ;
101- grd . addColorStop ( 1 , '#000 ' ) ;
102- text2 . fill = grd ;
127+ grd . addColorStop ( 1 , '#fff ' ) ;
128+ introText . fill = grd ;
103129
104- text2 . align = 'center ' ;
105- text2 . stroke = '#111' ;
106- text2 . strokeThickness = 1 ;
107- text2 . setShadow ( 2 , 2 , 'rgba(0,0,0,0.3)' , 2 ) ;
130+ introText . align = 'left ' ;
131+ introText . stroke = '#111' ;
132+ introText . strokeThickness = 1 ;
133+ introText . setShadow ( 2 , 2 , 'rgba(0,0,0,0.3)' , 2 ) ;
108134
109135
110- nextLine ( ) ;
136+ timeoutID = window . setTimeout ( slowIntroText , 10000 ) ;
111137
112- }
113138
139+ }
114140} ;
115141
116142
0 commit comments