/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 140)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "feature")
(use "game")
(use "main")
(use "obj")
(use "menubar")
(local
variable4
)
/******************************************************************************/
(instance public rm140 of Rm
	(properties
		picture scriptNumber
		north 0
		east 0
		south 0
		west 0
	)
	(method (init)
		(super:init())


		(self:setScript(Rm222))
  DisposeScript(980)
DisposeScript(983)
  SaveSpeed(4)
        (RoadStripes: init() cycleSpeed(1) setCycle(Fwd))
        (BgTrees: init() cycleSpeed(19) setCycle(Fwd))
        (BgTrees2: init() cycleSpeed(19) setCycle(Fwd))


        (car: init() cycleSpeed(0) setCycle(Fwd))
 = variable4 FALSE
 = gTimeSeconds2 0
     SaveSpeed(2)
             (send gTheMusic:
			prevSignal(0)
			stop()
			number(605)
			loop(-1)
			play()
		)
       (cloud1: init() moveSpeed(7) setMotion(MoveTo 0 27))
       (cloud2: init() moveSpeed(7) setMotion(MoveTo 0 33))
      ProgramControl()
		(SL:disable())
		(TheMenuBar:hide())
 // FormatPrint("Free Heap: %u Bytes\nLargest ptr: %u Bytes\nFreeHunk: %u KBytes\nLargest hunk: %u Bytes"
//MemoryInfo(miFREEHEAP) MemoryInfo(miLARGESTPTR) (>> MemoryInfo(miFREEHUNK) 6) MemoryInfo(miLARGESTHUNK))
	)
)
/******************************************************************************/
(instance Rm222 of Script
	(properties)
 (method(doit)
(if(== gTimeSeconds2 11)
= gTimeSeconds2 12
 (TheMenuBar:draw())
		(SL:enable())
        (RoadStripes: dispose())
        (BgTrees: dispose())
        (BgTrees2: dispose())
        (car: dispose())
       (cloud1:dispose())
       (cloud2:dispose())
     RestoreSpeed()
 (send gRoom: newRoom(266))
 )
(if(== gTimeSeconds2 6)
= gTimeSeconds2 7
 (if(not(variable4))
 = variable4 TRUE
 Print("...poffpoffpoff...pfffhhh...hhhh...")
 Print("You ran out of gas...")
 Print("But luckily you see a gas-station just ahead. You just hope that the car goes until there.")
 (car: init() cycleSpeed(0) setCycle(Fwd) moveSpeed(0) setMotion(MoveTo 320 172))
 ))
 )

)

(instance RoadStripes of Act
(properties
view 181
x 160
y 162
))
(instance BgTrees of Act
(properties
view 182
x 114
y 55
))
(instance BgTrees2 of Act
(properties
view 183
x 280
y 55
))
(instance cloud1 of Act
(properties
view 184
x 312
y 27
cel 1
))
(instance cloud2 of Act
(properties
view 184
x 170
y 33
cel 0
))
(instance car of Act
(properties
view 185
x 50
y 172
))

/******************************************************************************/

