Golf Trainer 500

Train your skills in this state-of-the-art golf simulator. A tiny TweetTweetJam-9 entry in 497 characters of code.

Features:

  • Friction
  • Terrain slope

Controls:

  • Left/Right: adjust angle
  • Up/down: adjust power
  • Fire: shoot

Code:

_set_fps(60)s=0o=0j=128f=rnd
g=cos
h=sin::_::cls(3)if(o<1)x=f(j)y=f(j)u=f(j)v=f(j)a=0z=30o=1w=f()r=2+f(4)
d=r*g(w)e=r*h(w)for i=0,63do
m=i%8*16n=i\8*16line(m-d-e,n-e+d,m,n,13)line(m-d+e,n-e-d)end
circ(u,v,2,15)?s
if o<2do
b=btn()a-=.005*((b&2)/2-(b&1))z=mid(z-(b&8)/8+(b&4)/4,80)m=z*g(a)n=z*h(a)circ(x,y,2,6)line(x,y,x+m,y+n,11)if(btnp(4))o=2b=m*.1c=n*.1
else
x+=b
y+=c
a=(b*b+c*c)^.5b+=d*a/500c+=e*a/500b*=.96c*=.96circfill(x,y,2,7)if((x-u)^2+(y-v)^2<5and a<1)s+=1o=0
if(a<.1)o=0
end
flip()goto _
StatusReleased
PlatformsHTML5
Rating
Rated 4.0 out of 5 stars
(1 total ratings)
AuthorSkyBerron
GenreSimulation
Made withPICO-8
TagsPICO-8, tweettweetjam

Leave a comment

Log in with itch.io to leave a comment.