2d scroller help

how do i make a 2d scorller were buttons control character movement

There are many 2d scroller templates around, some paid and some free.  Google around

here is some basic movement code with moving left and right and jumping.

Hope you enjoy! Any other questions pm me. :slight_smile:

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local physics = require("physics") --start physics physics.start() --make ground local ground = display.newRect(200,300,800,50) --make ground green ground:setFillColor(0,255,0) physics.addBody(ground,"static") --make player local player = display.newRect(100,100,50,50) physics.addBody(player,"dynamic") --make lft btn local Lbtn = display.newRect(30,300,70,30) --make right btn local Rbtn = display.newRect(120,300,70,30) local function moveL( event ) player.x = player.x - 10 end Lbtn:addEventListener("tap",moveL) local function moveR( event ) player.x = player.x + 10 end Rbtn:addEventListener("tap",moveR) --jump btn local up = display.newRect(400,300,70,30) -- Make player jump function up:touch(event) if(event.phase == "began") then player:setLinearVelocity( 0, -200 ) end end up:addEventListener("touch",up)

YOU"RE THE COOLEST person ever sorry for the caps thank you sooooooooooooooooOOoooooooooooooooooooooooooOOOOooOOoooOOOO much

There are many 2d scroller templates around, some paid and some free.  Google around

here is some basic movement code with moving left and right and jumping.

Hope you enjoy! Any other questions pm me. :slight_smile:

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local physics = require("physics") --start physics physics.start() --make ground local ground = display.newRect(200,300,800,50) --make ground green ground:setFillColor(0,255,0) physics.addBody(ground,"static") --make player local player = display.newRect(100,100,50,50) physics.addBody(player,"dynamic") --make lft btn local Lbtn = display.newRect(30,300,70,30) --make right btn local Rbtn = display.newRect(120,300,70,30) local function moveL( event ) player.x = player.x - 10 end Lbtn:addEventListener("tap",moveL) local function moveR( event ) player.x = player.x + 10 end Rbtn:addEventListener("tap",moveR) --jump btn local up = display.newRect(400,300,70,30) -- Make player jump function up:touch(event) if(event.phase == "began") then player:setLinearVelocity( 0, -200 ) end end up:addEventListener("touch",up)

YOU"RE THE COOLEST person ever sorry for the caps thank you sooooooooooooooooOOoooooooooooooooooooooooooOOOOooOOoooOOOO much