Hello
How I can make my ball stand in the middle of my racket?
please
thank you
https://www.dropbox.com/s/gm28erfiikq25 ... 2.zip?dl=0
How I can make my ball stand in the middle of my racket?
Re: How I can make my ball stand in the middle of my racket?
Code: Select all
if ball_should_stick then
ball.x = racket.x + 12
ball.y = racket.y + 34
end
Re: How I can make my ball stand in the middle of my racket?
thank you Of your answer
How I can do now so that my ball is glued to the racket ?
How I can do now so that my ball is glued to the racket ?
Re: How I can make my ball stand in the middle of my racket?
In the first line of the example I posted, there's a conditional statement. It checks if expression between "if" and "then" evaluates to "true". If you have this variable set to "false" then it will not activate sticking code, if it's set to true - it will.
Re: How I can make my ball stand in the middle of my racket?
Thank you
If I add it it does not work the ball does not stick :
At the beginning of the code I put:
-- La balle
local balle = {}
balle.x = 420
balle.y = 550
balle.colle = false
If I add it it does not work the ball does not stick :
Code: Select all
if balle_should_stick and balle.colle == true then
balle.x = raquette.x + 12
balle.y = raquette.y + 34
end
-- La balle
local balle = {}
balle.x = 420
balle.y = 550
balle.colle = false
Re: How I can make my ball stand in the middle of my racket?
The "balle_should_stick" is a made-up variable that you substitute with something on your own, it controls whether ball should stick or not. You have there "balle.colle" so you probably don't need that first one. Also since you never set it to anything, it evaluates to "false". You should just remove "balle_should_stick".
Re: How I can make my ball stand in the middle of my racket?
If I do that, it does not work I have more ball
Code: Select all
if balle.colle == true then
balle.x = raquette.x + 12
balle.y = raquette.y + 34
end
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest