
-----------------------------------
copthesaint
Sat Feb 28, 2009 10:27 am

Play M8's Mini Golf
-----------------------------------
Now normally I would have trouble loading the vars from a text file but for some reason it isn't working.
The Golf ball position should be at 100, 100 but it always put 0,0... any help? I also used the find to see if I was setting The golf ball X somewhere else but I couldn't find it...

-----------------------------------
The_Bean
Sat Feb 28, 2009 3:07 pm

Re: Play M8's Mini Golf
-----------------------------------
Your initializing the ball to 0 at the beginning of the program.
When you load from the file it doesn't actually change the value, and the loading looks a lot more complicate than it actually needs to be.
You should actually be using a 2D arrays to hold the map info.

My loading for this 
    open : fileNum, "maps/" + maps (strint (mapNum) + 2), get
    for decreasing y : 19 .. 0
        for x : 0 .. 19
            get : fileNum, map (x, y)
        end for
    end for
    get : fileNum, xBall, yBall
    get : fileNum, xHole, yHole
    close : fileNum


-----------------------------------
copthesaint
Sat Feb 28, 2009 6:43 pm

Re: Play M8's Mini Golf
-----------------------------------

Your initializing the ball to 0 at the beginning of the program.
When you load from the file it doesn't actually change the value, and the loading looks a lot more complicate than it actually needs to be.

No it's being set...

Line : 56
[code]GolfballXSet := strreal (line)[/code]

line 310
[code]procedure GolfBallDraw
    GolfballXSet += GolfballXincr
    GolfballYSet += GolfballYincr
    GolfballX1 := GolfballXSet
    GolfballY1 := GolfballYSet
    Pic.Draw (GolfBall, round (GolfballX1), round (GolfballY1), picMerge)
    GolfballX2 := GolfballX1 + Pic.Width (GolfBall)
    GolfballY2 := GolfballY1 + Pic.Height (GolfBall)
end GolfBallDraw[/code]

-----------------------------------
The_Bean
Sun Mar 01, 2009 1:06 pm

Re: Play M8's Mini Golf
-----------------------------------

        elsif nextvar = 5 and skipvar = 0 and strintok (line) = true then
            put 'the x value is being set'
            delay (100000)
            GolfballXSet := strreal (line)
            skipvar := 1
            nextvar := 6

The program is never delayed because the delay is never run because theres something wrong with the way your loading, which means that the x value of the golf ball isn't being set.
