[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[m8n] piLove

To run S8 (m8n platform) with Löve framework on a Raspberry pi follow this steps:
  1. Start from a clean Raspbian system
  2. install Love with
    sudo apt-get install love2d
  3. Decompress the m8n-console.zip at /Home/pi/Desktop/m8n
  4. Add a folder to host your game files
    md ~/lovegame
  5. Add a main.lua file with code to load S8 and start the SystemServer
    local m8n="/Home/pi/Desktop/m8n/"
    dofile(m8n.."s8.snapshot.lua")
    print(("'3+4=',(3+4)"):evaluate())
    --print(smalltalk.Object:selectors():sorted():asLiteral())
    
    dofile(m8n.."s8/library/luasocket.st.lua")
    dofile(m8n.."s8/library/SimpleHTTPServer.st.lua")
    dofile(m8n.."s8/library/SimpleJson.st.lua")
    dofile(m8n.."s8/library/systemServer/SystemServer.st.lua")
    dofile(m8n.."s8/library/swiki/swiki.st.lua")
    dofile(m8n.."s8/library/swiki/swikiLove.st.lua")
    dofile(m8n.."library/love/love.st.lua")
    dofile(m8n.."library/love/loveSamples.st.lua")
    
    smalltalk.Sample = "loaded"
    code=[[
      SystemServer silent: true.
      SystemServer start.
      Sample := #started.
    ]]
    code:fileIn()
    x=0
    function love.draw()
    	smalltalk.SystemServer:current():step()
    	x = x + 10
    	love.graphics.print(tostring(smalltalk.Sample), x, 300)
    	if x>800 then x=0 end
    end
    
  6. start the Love app
    love ~/lovegame
  7. Now you can enter the system with U8 tools connected to the SystemServer as usual (use connect icon in a workspace to connect to localhost:8088)