/******************************************************************************
 SCI Template Game
 By Brian Provinciano
 ******************************************************************************
 titlescreen.sc
 Contains the title screen room.
 ******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 802)
/******************************************************************************/
(use "main")
(use "game")
(use "menubar")
(use "obj")
(use "cycle")
(use "user")
(use "controls")
(use "feature")
(local
ready2
rrr
clicked = 1
)
/******************************************************************************/
(instance public TitleScreen of Rm
	(properties
		picture 8
	)
	(method (init)
        // Set up the title screen
		ProgramControl()
		= gProgramControl FALSE
		(send gGame:setSpeed(1))
		(SL:disable())
		(TheMenuBar:hide())

		(super:init())
		(self:setScript(RoomScript))

		(send gEgo:
			init()
			hide()
         )





        /**************************************************
         * Add the rest of your initialization stuff here *
         **************************************************/
     = gTimeSeconds 9

 )
)
/******************************************************************************/
(instance RoomScript of Script
	(properties)
    (method (changeState newState)
 = state newState
  (switch (state)
    (case 0
   (send gGame:setSpeed(3))
      Wait(28)
  DrawPic(801)
  (aPic: init())
Display("Profile:" dsCOORD 160 25 dsCOLOUR clBLACK dsBACKGROUND clTRANSPARENT)
Display("Name:" dsCOORD 120 45 dsCOLOUR clNAVY dsBACKGROUND clTRANSPARENT)
Display("  Jimmy Jummybummy" dsCOORD 115 55 dsCOLOUR clBLACK dsBACKGROUND clTRANSPARENT)
Display("Age:" dsCOORD 120 75 dsCOLOUR clNAVY dsBACKGROUND clTRANSPARENT)
Display("  34" dsCOORD 115 85 dsCOLOUR clBLACK dsBACKGROUND clTRANSPARENT)
Display("Hobbies:" dsCOORD 120 105 dsCOLOUR clNAVY dsBACKGROUND clTRANSPARENT)
Display("  Inventing stuff" dsCOORD 115 115 dsCOLOUR clBLACK dsBACKGROUND clTRANSPARENT)
Display("Location:" dsCOORD 120 135 dsCOLOUR clNAVY dsBACKGROUND clTRANSPARENT)
Display("  New Yerk, CA" dsCOORD 115 145 dsCOLOUR clBLACK dsBACKGROUND clTRANSPARENT)
(aE: init() moveSpeed(1) setMotion(MoveTo 150 1 RoomScript))
)
(case 1
(aDr: hide())
  (aPic: hide())

DrawPic(1)
  = rrr TRUE
 (send gGame:setSpeed(4))
(aMan: init() loop(3))
Wait(30)
Print("Now this has to work!" #title"Dr.Jummybummy:" #icon 777 0 18)
= clicked 1
Wait(15)
(aMan: setCycle(Walk) setMotion(MoveTo 133 115 RoomScript))
)
(case 2
(aMan: setCycle(Walk) setMotion(MoveTo 227 101 RoomScript))
)
(case 3
(aMan: setCycle(Walk) setMotion(MoveTo 227 99 RoomScript))
)
(case 4
(aMan: loop(3))
Wait(20)
Print("Some final calculations..." #title"Dr.Jummybummy:" #icon 777 0 18)
= clicked 1
Wait(30)
Print("And ... START!" #title"Dr.Jummybummy:" #icon 777 0 18)
= clicked 1
ShakeScreen(4 ssFULL_SHAKE)
            ShakeScreen(4 ssLEFTRIGHT)
              ShakeScreen(4 ssFULL_SHAKE)
            ShakeScreen(4 ssLEFTRIGHT)
            ShakeScreen(4 ssLEFTRIGHT)
              ShakeScreen(4 ssFULL_SHAKE)
            ShakeScreen(4 ssLEFTRIGHT)
            Wait(35)
  Print("Hmm...nothing happened. Guess I have forgotten some part...?" #title"Dr.Jummybummy:" #icon 777 0 18)
  = clicked 1
 (aMan: setCycle(Walk) setMotion(MoveTo 133 115 RoomScript))
 )
 (case 5
  (aMan: setCycle(Walk) setMotion(MoveTo 105 87 RoomScript))
  )
  (case 6
    (aMan: setCycle(Walk) setMotion(MoveTo 109 83 RoomScript))
    )
  (case 7
  Wait(25)
  Print("Of course! I forgot the transmitter! Stupid me. (And where are my glasses? Can't see very well without them.)"  #title"Dr.Jummybummy:" #icon 777 0 18)
  = clicked 1
  (send gTheMusic: fade())
  (aMan: setCycle(Walk) setMotion(MoveTo 150 130 RoomScript))
  
  )
  (case 8
  Wait(20)
   DrawPic(8)
   (aMan: hide())
       (send gTheMusic:
			prevSignal(0)
			stop()
			number(774)
			loop(-1)
			play()
		)
Display("Meanwhile, in a galaxy far, far away..." dsCOORD 40 90 dsCOLOUR clNAVY dsBACKGROUND clTRANSPARENT dsFONT 900)
Display("Meanwhile, in a galaxy far, far away..." dsCOORD 39 89 dsCOLOUR clBLUE dsBACKGROUND clTRANSPARENT dsFONT 900)
(aE: init() setMotion(MoveTo 130 1 RoomScript))
)
(case 9
  (send gRoom:newRoom(803))

      )
    )
    )
	(method (handleEvent pEvent)
      (var button2)
        (super:handleEvent(pEvent))
        (if( not (send pEvent:claimed) )

         		(if( (== (send pEvent:type) evKEYBOARD))
                /******************************************
                 * If the title screen has music, fade it *
                 ******************************************/
				//(send gTheMusic:fade())

                // End the title screen, start the game
= button2 Print(
  "Are you sure you want to cancel the intro. It includes some useful clues."
  #title "Make your selection:"
  #font 999
  #button " No " 1
  #button " Yes " 0
)

(if(== button2 0)
 (send gRoom:newRoom(INITROOMS_SCRIPT))
 return
)(else
return

))))
(method(doit)
(if(== gTimeSeconds 7)
= clicked 0
)
)
)


 (instance aBor of Act
 (properties
 view 302
 x 35
 y 100
 cycleSpeed 3
 ))
 (instance aDr of Act
 (properties
 view 303
 x 35
 y 100
 cycleSpeed 4
 ))
 (instance aE of Act
 (properties
 view 300
 x 1
 y 1
 ))
  (instance aMan of Act
 (properties
 view 1
 x 102
 y 83
 ))
   (instance aPic of Act
 (properties
 view 86
 x 135
 y 41
 ))
