Give the player an instance variable NumberOfBullets
Keybord on space bar pressed
player compare variable NumberOfBullets > 0
Keyboard on R pressed
player compare variable NumberOfBullets = 0
Put the tank and turret in a container.
https://www.scirra.com/manual/150/containers
or add a turret is nearest condition.
Using physics for something like this does seem overkill, bullet-behaviour with gravity would do just about the same.
My guess is you should check your collision-polygons or set collision-mode to bounding box.
You could try the condition:
Mushroomcrab pick nearest to bosscrab.x, bosscrab.y
I'm not sure why you'd want to slow down over time, but using lerp wouldn't be necessary.
every x seconds set the speed to speed-10 would work,
But I would opt for trying bullet gravity..
Wouldn't it just be a
on button down - rotate towards angle
on button not down - rotate towards angle
adding a condition - if angle is between bla and blabla to not trigger if unneeded and offf you go..
Setting the speed to 0 for the movement behaviour is my first guess
If you multiply the first number by 10 you could just add them up..
Could you just set the player speed to 0 on landing?
Add another condition..
playbuttonone - frame is 1
right click on the event and choose add another condition, the event will only trigger if both conditions are true.
So is not touching + frame is 1
Right click on the event and click add another condition..
You could use this extra condition:
On touch end
palybuttonone - frame is 1
or just adding the frame is 1 condition to your current event should work too..
If you have a variable called money, adding the condition system compare - money>20 to the build event should work.
So for example:
On walls clicked
system compare : money>20
-- build turret
-- subtract 10 from money
Using the clamp expression you could probably get this done.
It would look something like this:
Upper body set angle - clamp(angle(upperbody.x, upperbody.y, mouse.x, mouse.y), lowerbody.angle-90, lowerbody.angle+90)
Develop games in your browser. Powerful, performant & highly capable.
Using random in a global variable shouldn't be a problem.