With your trusty spacecraft chart a huge galaxy! One star down, 16383 more to go!

Controls

  • Arrow keys to move your ship.
  • Move to the edge of the screen to fly to another star.
  • Each time you visit a new star, your exploration percentage goes up.

Code

q={}s=128x=9y=63pal({-15,1,-13,-4,12},1)b=0v=0j=0k=0g=0h=0e,u,w=srand,circfill,rnd::_::p=btn()j+=(p\2%2-p%2)/4k+=(p\8%2-p\4%2)/4e(t())for i=0,400do
n=w(s)m=w(s)circ(n,m,1,abs(pget(n,m)-1))end
camera(v,b)v*=.8b*=.8e(r)for i=0,99do
n=w(s)m=w(s)pset(n,m,5)end
l=0for i=0,w(9)do
a=w()+t()/i/9f=i<1and w(3)+9or 1+w(i)u(l*cos(a)+63,l*sin(a)+63-i,f,7)l+=f+w(9)+5end
x+=j
y+=k
if(x<0or x>s)g+=sgn(j)v=s*-sgn(j)x%=s
if(y<0or y>s)h+=sgn(k)b=s*-sgn(k)y%=s
?(#q/4^7*100).."%",2,2
r=g+s*h
for i in all(q)do
if(i==r)goto e
end
add(q,r)::e::u(x,y,1,7)j*=.9k*=.9flip()goto _
StatusReleased
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(5 total ratings)
AuthorMunro
GenreSimulation
Made withPICO-8
TagsExploration, PICO-8, Pixel Art, Retro, Singleplayer, Space, Space Sim

Comments

Log in with itch.io to leave a comment.

This is amazing, and kind-of hypnotically beautiful!!!

Cool star system generation! I've got a lot of percents left to go...

Great lord! This is a good looking game.

Do you have a non-minimized version of the p8 to share for learning purposes?

(1 edit) (+1)

not before you asked! 

known_stars={}
num=128
px=63
py=9
pal({-15,1,-13,-4,12},1)
cx=0
cy=0
cam_v_x=0
cam_v_y=0
p_v_x=0
p_v_y=0
mx=0
my=0
_srand,_circfill,_rnd=srand,circfill,rnd
::_::
--dale's four direction control handler
_btn=btn()
p_v_x+=(_btn\2%2-_btn%2)/4
p_v_y+=(_btn\8%2-_btn\4%2)/4
--[[
create a seed from time so 
the background works
]]--
_srand(t())
--[[
magic part:
draw a circ at a random position with a reduced color of that pixel 400 times
clears the screen but creates a nice fade
]]--
for i=0,400do
    rx=_rnd(num)
    ry=_rnd(num)
    circ(rx,ry,1,abs(pget(rx,ry)-1))
end
--camera velocity update
camera(cx,cy)
cx*=.8
cy*=.8
--randomness is set to the system seed
_srand(r)
--draw a bunch of dots as background stars
for i=0,99do
    rx=_rnd(num)
    ry=_rnd(num)
    _circfill(rx,ry,0,5)
end
--[[
star system generation:
-pick between 1 and 9 bodies
-give each a random angle from the center
-draw them
-add their distance+size+rnd to the distance of the next body
]]--
l=0
for i=0,_rnd(9)do
    a=_rnd()+t()/i/9
    f=i<1and _rnd(5)+5or _rnd(i)
    _circfill(l*cos(a)+63,l*sin(a)+63-i,f,7)
    l+=f+_rnd(9)+4
end
--add player velocity to their pos
px+=p_v_x
py+=p_v_y
--when player goes off screen add a camera offset and change their system coridinate
if(px<0or px>num)mx+=sgn(p_v_x)cx=num*-p_v_x
if(py<0or py>num)my+=sgn(p_v_y)cy=num*-p_v_y
?(#known_stars/4^7*100).."% "..mx.." "..my,2,2
--generates unique seed for 128x128 star systems
r=mx+num*my
--loop the player around the screen
px%=num
py%=num
--draw player and reduce their velocity
_circfill(px,py,1)
p_v_x*=.9
p_v_y*=.9
flip()
--check if current star is known. 
--if it finds it, skips to the start of the loop
--if not add it to the list.
for i=1,#known_stars do
    if(known_stars[i]==r)goto _
end
add(known_stars,r)goto _

*edit* also should mention still tweaking the code. this version differs from the one in html/desc rn

Awesome. Thanks!