(version 2)
(include "sci.sh")
(exports
    0 rm755
)
(use "Main")
(use "Polygon")
(use "Cycle")
(use "Game")
(use "Obj")
(script 755)



(instance public rm755 of Rm
    (properties
        noun 1
        picture 755
        vanishingY -60
    )

    (method (init)
        (send global2:addObstacle((send ((Polygon:new())):
                type(2)
                init(0 0 319 0 319 164 211 164 185 152 159 128 215 116 247 88 142 54 120 56 117 47 48 47 10 43 0 37)
                yourself()
            )
 (send ((Polygon:new())):
                type(2)
                init(0 44 40 55 50 60 106 64 144 57 243 89 215 110 143 126 32 91 0 86)
                yourself()
            )
 (send ((Polygon:new())):
                type(2)
                init(0 96 34 94 141 133 206 168 196 174 124 183 103 189 0 189)
                yourself()
            )
 (send ((Polygon:new())):
                type(2)
                init(53 58 53 51 113 51 113 58)
                yourself()
            )
))
        (if (== gGClientModNum 750)
            = style 12
            (if (< (send gOwner:y) 70)
                (self:setScript(enterTop))
            )(else
                (self:setScript(enterBottom))
            )
        )(else
            (send gOwner:
                setScale(190)
                normalize()
                x(300)
                y(180)
                init()
            )
        )
        (super:init())
    )


    (method (doit)
        (if (GameIsRestarting())
            (send gLongSong:
                number(750)
                setLoop(-1)
                play(127)
            )
            (send gLongSong2:
                number(391)
                setLoop(-1)
                play(90)
            )
        )
        (if (script)
            0
        )(else
            (if (<= (send gOwner:x) 5)
                (send global2:setScript(exitWest))
            )(else
                (if ((>= (send gOwner:x) 315) or (>= (send gOwner:y) 183))
                    (send global2:setScript(exitEast))
                )
            )
        )
        (super:doit())
    )

)
(instance enterTop of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    setScale(190)
                    x(0)
                    normalize()
                    init()
                )
                = cycles 1
            )
            (case 1
                (send gOwner:setMotion(MoveTo 45 55 self))
            )
            (case 2
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance enterBottom of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    setScale(190)
                    x(0)
                    normalize()
                    init()
                )
                = cycles 1
            )
            (case 1
                (send gOwner:setMotion(MoveTo 10 93 self))
            )
            (case 2
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance exitWest of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:setMotion(MoveTo 0 (send gOwner:y) self))
            )
            (case 1
                (send global2:newRoom(750))
                (self:dispose())
            )
        )
    )

)
(instance exitEast of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (>= (send gOwner:x) 310)
                    (send gOwner:setMotion(MoveTo 340 (send gOwner:y) self))
                )(else
                    (send gOwner:setMotion(MoveTo (send gOwner:x) 200 self))
                )
            )
            (case 1
                (send global2:newRoom(170))
            )
        )
    )

)
