
-----------------------------------
frank26080115
Sun Dec 10, 2006 11:41 pm

Speed Math Tweek for 3D Game
-----------------------------------
I made this game after playing "the missile game 3d" on albino black sheep

the flash one is here
http://www.albinoblacksheep.com/games/missilegame3d

the one i made is similar and simpler, but the gates appear to slow down as they get closer, i tried to tweek it as much as possible, but if sometimes it gets jerky and stuff and i'm out of ideas, i marked out the stuff that is responsible for the obstacle gates movement and size

can you help me tweek the equations

var winID : int
var mx, my, mbutton : int
var xoff, yoff : int
var width1, height1 : int := 500
var rx1, lx1, ty1, by1 : real
var rx2, lx2, ty2, by2 : real
var rx3, lx3, ty3, by3 : real
var rx4, lx4, ty4, by4 : real
var obsx, obsy, rad1 : real
var ang1 : int := 0
var ang2 : int := ang1 + 270
var anginc : int := 10
var rotdir : int := 1
%%% variables for the gates %%%
var dividedinto : real := 20
var divfac1 : real := 0.125
var divfacacc1 : real := 0.125
var divfacacc2 : real := 0.125
%%% variables for the gates %%%
var score1 : int := 0
var font : int
font := Font.New ("serif:12")

winID := Window.Open ("position:center;center,graphics:" + intstr (width1) + ";" + intstr (height1) + ",nobuttonbar")
loop
    setscreen ("offscreenonly")
    loop
        % mouse
        Mouse.Where (mx, my, mbutton)
        mx := maxx - mx
        my := maxy - my
        if mx >= width1 then
            mx := width1
        elsif mx = width1 then
            my := width1
        elsif my  dividedinto + 25 then
            %%% variable reset %%%
            divfac1 := 0.125
            divfacacc1 := 0.125
            ang1 := Rand.Int (0, 360)
            anginc := Rand.Int (0, 10)
            rotdir := Rand.Int (1, 2)
            %%% variable reset %%%
        elsif divfac1 > dividedinto + 10 and whatdotcolor (maxx div 2, maxy div 2) = grey then
            exit
        end if
        if ang1 > 360 then
            ang1 := 0
        end if
        score1 += 1
        % end of frame
        delay (100)
        View.Update
        cls
    end loop
    cls
    setscreen ("graphic")
    put "you lose"
    View.Update
    delay (1000)
    divfac1 := 0.125
    divfacacc1 := 0.125
    ang1 := Rand.Int (0, 360)
    anginc := Rand.Int (0, 10)
    rotdir := Rand.Int (1, 2)
    score1 := 0
end loop


-----------------------------------
Hackmaster
Mon Dec 11, 2006 12:46 pm


-----------------------------------
Good Stuff, Frank! again, you made a pretty sweet program. you are definally ramping up to be a really active, contributing member on this site! keep up the good work. 

By the way.. it does seem pretty jerky up near the front. as it turns out, it's almost impossible to lose up near the front. good randomization though!

keep it up!

-----------------------------------
frank26080115
Tue Dec 12, 2006 12:42 am


-----------------------------------
its not that its jerky, its that it appears to slow down, so i'm asking everyone to play around with the numbers until somebody gets a realistic look

i'm moving on the harder/easier stuff, PBASIC !! check out my main focus these days http://franksjunk.thespudmall.com/sumobot/
