Just wondering, but could this script be accurately converted to GM? (I am so use to SilverCreater that I have very little experience with GM scripting)
***This is when the Card opens***
CREATESPRITE background, "background"
MOVESPRITE background, SPRITEX(2) - 500, SPRITEY(2) - 500, true
CREATESPRITE topmountainblock, "topmountainblock"
MOVESPRITE topmountainblock, 0, SPRITEY(2) - 335, true
CREATESPRITE bottommountainblock, "topmountainblock"
MOVESPRITE bottommountainblock, 0, SPRITEY(2)-550, true
CREATESPRITE leftmountainblock, "sidemountainblock"
MOVESPRITE leftmountainblock, SPRITEY(2) -330, 0, true
FOR x=1 to 10
IF spritevalid(x)=1 then
SHOWSPRITE x,1
END IF
NEXT
MOVESPRITE man, 290, 150, 1
MOVESPRITE bar, 282, 187, 1
CREATESPRITE bar2, "Bar", 1
MOVESPRITE bar2, 282, 187
LET monsterattack = 1
CREATESPRITE background, "background"
MOVESPRITE background, SPRITEX(2) - 500, SPRITEY(2) - 500, true
CREATESPRITE man, "mandown"
MOVESPRITE man, 290, 150, true
SCALESPRITE man, 100
ON TIMER 120
LET npcwalk = Random(40)
LET npcdir = RANDOM(4)
SELECT CASE npcdir
CASE 1
LET npcdir$ = "up"
RECREATESPRITE fnpc, "manup", 1
PUSHSPRITE fnpc, 0, -npcwalk
CASE 2
LET npcdir$ = "left"
RECREATESPRITE fnpc, "manleft", 1
PUSHSPRITE fnpc, -npcwalk, 0
CASE 3
LET npcdir$ = "down"
RECREATESPRITE fnpc, "mandown", 1
PUSHSPRITE fnpc, 0, npcwalk
CASE 4
LET npcdir$ = "right"
RECREATESPRITE fnpc, "manright", 1
PUSHSPRITE fnpc, npcwalk, 0
END SELECT
END TIMER
IF text2 = 0 then
LET text2 = 1
END IF
***This is when someone presses a Key***
LET walk=walk+1
IF walk=6 Then
LET walk=1
END IF
LET pushX=0
LET pushY=0
SELECT CASE key$
CASE uparrow$
LET dir$="up"
LET pushy=10
CASE downarrow$
LET dir$="down"
LET pushy=-10
CASE leftarrow$
LET dir$="left"
LET pushx=10
CASE rightarrow$
LET dir$="right"
LET pushx=-10
END SELECT
IF SHIFTKEY = TRUE THEN
LET pushx=pushx*3
LET pushy=pushy*3
END IF
SELECT CASE dir$
CASE "up"
IF walk<4 then
RECREATESPRITE man, "manup1", 1
ELSE
RECREATESPRITE man, "manup", 1
END IF
CASE "down"
IF walk<4 then
RECREATESPRITE man, "mandown1", 1
ELSE
RECREATESPRITE man, "mandown", 1
END IF
CASE "right"
IF walk<4 then
RECREATESPRITE man, "manright1", 1
ELSE
RECREATESPRITE man, "manright", 1
END IF
CASE "left"
IF walk<4 then
RECREATESPRITE man, "manleft1", 1
ELSE
RECREATESPRITE man, "manleft", 1
END IF
END SELECT
FOR x=1 to 16
IF spritevalid(x)=1 then
PUSHSPRITE x, pushX, pushY, 1 //process the movement
END IF
NEXT
LET move=1
FOR x=2 to 4
IF spritevalid(x)=1 then
IF spritestouching(man, x)=1 then
LET move=0 //if man is touching obstacle let move=0
END IF
END IF
NEXT
IF spritestouching(man, topmountainblock)=1 then
LET move = 0
END IF
IF spritestouching(man, bottommountainblock)=1 then
LET move = 0
END IF
IF spritestouching(man, wildgrass)=1 then
IF monsterattack = 1 then
LET x=random(10) //chance of enemy encounter
IF x=1 then
LOAD_ENEMY
LET monsterattack=2
END IF
END IF
IF monsterattack = 2 then
LET x=random(20) //chance of enemy encounter
IF x=2 then
LOAD_ENEMY
LET monsterattack=1
END IF
END IF
END IF
IF spritestouching(man, inndoor)=1 then
GOTOCARD 5
END IF
IF spritestouching(man, blacksmithdoor)=1 then
GOTOCARD 6
END IF
IF spritestouching(man, potiondoor)=1 then
GOTOCARD 7
END IF
IF move=0 then //if move=0 then push everything back
IF pushX>0 then
LET pushX=-ABS(pushX)
ELSE
LET pushX=ABS(pushX)
END IF
IF pushY>0 then
LET pushY=-ABS(pushY)
ELSE
LET pushY=ABS(pushY)
END IF
FOR x=1 to 16
IF spritevalid(x)=1 then
PUSHSPRITE x, pushX, pushY, 1
END IF
NEXT
END IF
SHOWSPRITE man
LET backgroundX = SPRITEX("background")
LET backgroundY = SPRITEY("background")
***This is when the card closes***
FOR x=1 to 9
IF spritevalid(x)=1 then
HIDESPRITE x,1
END IF
NEXT
stoptimer
This is basicly the entire code for walking. It actually runs pretty smooth. How well can this be converted?
Thanks,
-Gandolf