ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator How to make character fly from shooting?
person icon
dekon_17
Registered User
Quote
2021-11-03 17:02:03

So, yeah, I'm here again, and I have a trouble with scripting.
I'm trying to make a mobile game. And I wanted to make "2D" movement slightly different. Character has a gun, which should push the palyer away with recoil and, well, shoot.

The thing is that the gun constantly rotates, so, recoil vector should be different pretty much. And, uh-h, I don't exactly know how to push player away according to rotation of weapon, due to the fact that, well, I am not that comparable with maths.

For better explaination, here's the screenshot to demonstrate what I need:
embedded external image
🔎︎


person icon
dekon_17
Registered User
Quote
2021-11-11 09:07:54

Hello again.

I've managed to make the script for it (ha-ha, evolution), but I can't make it move object smoothly. The thing is:

1) If I add "return false" in "if (this.LastTime == null)" and "return true" in the end of script, then it, for some reason, turns "if (this.LastTime == null)" into a cycle, while the rest of script isn't working.

2) If I won't add these, then script gives me this message in the log: "action_PunchBack:32:TypeError: pos is undefined".

I know, I am bad at explaining the problems with my sh- I mean, code, so, I'll leave the prototype of project (to better understand how it works): https://disk.yandex.ru/d/EJgFHDR...

embedded external image
🔎︎



Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |