Jump to content

Recommended Posts

Hi everyone,

Been away for a while but I've kept practicing with Babylon. This is at a prototype phase with no 3d/sound/artwork. Just pure javascript code for now. Trying to get the mechanics working properly first.

One question I have is how the projectile rotationQuaternion is cloned. It seems to follow the lookAt() quaternion from the origin tower even after the quaternion is cloned. How can I ensure that the rotationQuaternion is not linked to the original quaternion it is taken from? This causes problems when a tower shoots a projectile and then rotates to target another enemy. The previously mentioned projectile rotates in midair still copying the rotation of the tower.

Here's the relevant code taken from line 53 of https://github.com/xtreemze/defend/blob/master/src/js/main/projectiles.ts

    const clonedRotation = originMesh.rotationQuaternion.clone();
    clonedRotation.normalize();

    projectile.rotationQuaternion.copyFrom(clonedRotation);

 

Comments, questions are welcome!

The project is hosted here with open source: https://github.com/xtreemze/defend

View the project here: https://xtreemze.github.io/defend

screenshot_-6-5_11-19 (44).png

screenshot_-6-5_11-19 (61).png

Link to comment
Share on other sites

On 6/5/2018 at 6:00 PM, Deltakosh said:

Really cool!

can you create a repro on the problem in the PG?

Thanks, I solved it by delaying the firing of the projectile to give the lookAt function some time to complete. Don't think it's anything wrong with the engine, just too many position queries on the meshes on every frame to measure distances and acquire the nearest target. The delay is not noticeable.

 

Updated: now with generated sound thanks to the WASFX library by @fenomas

screenshot.png

Link to comment
Share on other sites

  • 5 weeks later...
  • 4 weeks later...

Thanks everyone for having a look! I've done a lot of work on balancing and improving the feel to increase fun and reduce frustrations. Veteran John Romero says your first 10 - 20 games will suck, and this one still isn't #20 yet. With that in mind, comments that may improve this game, or my approach for future games would be greatly appreciated ?. Just as well if you see this and wonder how something works, I'd be more than happy to help.

You're welcome to give it a try again if you've played before because it's a very different feel since I last updated this post.

Play here: https://xtreemze.github.io/defend

Link to comment
Share on other sites

oh, this new version is a big improvement! it's a lot more clicky to get a victory - only thing is that it would be harder if the base didn't regenerate so fast and also it seems the new attackers come predominately from two opposing sides, whereas before it felt more balanced.  anyway, it's lots of fun - thanks for sharing!!

Link to comment
Share on other sites

3 hours ago, brianzinn said:

oh, this new version is a big improvement! it's a lot more clicky to get a victory - only thing is that it would be harder if the base didn't regenerate so fast and also it seems the new attackers come predominately from two opposing sides, whereas before it felt more balanced.  anyway, it's lots of fun - thanks for sharing!!

Good feedback, thanks @brianzinn! I did try to make the game more forgiving but based on your feedback I'll increase the difficulty so it feels more rewarding in the end.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...