PicoPicoGameEngine

Quick Links

Key Objects

ppkey

.up()
.down()
.left()
.right()
.a()
.b()
.c()
.d()
.e()
.f()
.g()
.h()
.x()
.y()
.leftShoulder()
.rightShoulder()
.pause()

push = ppkey.up([trigger_flag])
push = ppkey.down([trigger_flag])
push = ppkey.left([trigger_flag])
push = ppkey.right([trigger_flag])
push = ppkey.a([trigger_flag])
push = ppkey.b([trigger_flag])
push = ppkey.c([trigger_flag])
push = ppkey.d([trigger_flag])
push = ppkey.e([trigger_flag])
push = ppkey.f([trigger_flag])
push = ppkey.g([trigger_flag])
push = ppkey.h([trigger_flag])
push = ppkey.x([trigger_flag])
push = ppkey.y([trigger_flag])
push = ppkey.leftShoulder([trigger_flag])
push = ppkey.rightShoulder([trigger_flag])
push = ppkey.pause()
push : boolean

  • true
  • false
[trigger_flag] : boolean/optional

  • true
  • false

ppvkey

:touch()

touch = ppvkey:touch()
touch : boolean

  • true
  • false
pptex:default(
  pptex:load("sample.png"))
fighter=ppsprite.new()
fighter:tile(2)
mv={{1,0},{0,-1},{-1,0},{0,1}}
s=ppscreen:size()
ppvkey:center(
  s.width/2,s.height/2)

p16=pppoint(16,16)
fighter:pos(
  ppvkey:center()-p16)

function start()
  if ppvkey:touch() then
    fighter:move(
      mv[ppvkey:dir(4)+1])
    ppgraph:print(ppvkey:dir(4))
  end
  ppgraph:put(
    ppvkey:center()-p16,7)
  fighter:draw()
end

:delta()

delta = ppvkey:delta()
delta : point object

:dir()

dir = ppvkey:dir(division,[area])
division : number

[area] : rectangle object/optional

dir : number

:center()

ppvkey:center(x,y)
ppvkey:center({x,y})
ppvkey:center(position)
x : number

y : number

position : point object

:fixed()

ppvkey:fixed(flag)
flag : boolean

  • true
  • false
pptex:default(
  pptex:load("sample.png"))
fighter=ppsprite.new()
fighter:tile(2)
mv={{1,0},{0,-1},{-1,0},{0,1}}
ppvkey:fixed(true)
s=ppscreen:size()
ppvkey:center(
  s.width/2,s.height/2)

p16=pppoint(16,16)
fighter:pos(
  ppvkey:center()-p16)

function start()
  if ppvkey:touch() then
    fighter:move(
      mv[ppvkey:dir(4)+1])
    ppgraph:print(ppvkey:dir(4))
  end
  ppgraph:put(
    ppvkey:center()-p16,7)
  fighter:draw()
end