Add recoil velocity
This commit is contained in:
@@ -247,6 +247,9 @@ const Shoot = (() => {
|
|||||||
const run = Math.cos(radians) * cannonLength;
|
const run = Math.cos(radians) * cannonLength;
|
||||||
const origin = { x: x + run, y: y + rise };
|
const origin = { x: x + run, y: y + rise };
|
||||||
|
|
||||||
|
const { x: vx, y: vy } = Velocity[entity_id];
|
||||||
|
Velocity[entity_id] = { x: vx - run, y: vy - rise };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
origin,
|
origin,
|
||||||
target: {
|
target: {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Reference in New Issue
Block a user