Ok I can’t figure out how to make a bullet luanch out of my moving object,
my object in the code is a simple red square, controlled by a simple joystick using the lib_analog_stick.lua file and i modified it a bit to use my own images for the joystick, i’ve looked all around and i still can’t find a solution to my problem
p.s.
I deleted any try at shooting, i need a code or some advice on how to shoot with a joystick-controlled player
[code]
display.setStatusBar( display.HiddenStatusBar )
local physics = require( “physics”)
physics.start()
physics.setGravity( 0, 0 )
system.activate( “multitouch” )
local background = display.newImage(“gameb.png”)
background.x = 160
background.y = 240
local button = display.newImage(“button.png”)
button.x = 40
button.y = 420
background.rotation = 90
local StickLib = require(“lib_analog_stick”)
local screenW = display.contentWidth
local screenH = display.contentHeight
local Text = display.newText( " ", screenW*.6, screenH-20, native.systemFont, 15 )
– CREATE A SPACE SHIP
local Ship = display.newImage(“red.png”)
Ship.x = 160
Ship.y = 240
Ship.xScale = .5
Ship.yScale = .5
physics.addBody( Ship)
– CREATE ANALOG STICK
MyStick = StickLib.NewStick(
{
borderImage =“joystickb.png”,
thumbImage =“joystickt.png”,
x = 30,
y = 60,
thumbSize = 16,
borderSize = 32,
snapBackSpeed = .6,
} )
[import]uid: 113909 topic_id: 21030 reply_id: 321030[/import]
[import]uid: 52491 topic_id: 21030 reply_id: 83085[/import]
[import]uid: 10379 topic_id: 21030 reply_id: 83089[/import]
[import]uid: 52491 topic_id: 21030 reply_id: 83102[/import]