Coder Social home page Coder Social logo

Shooting (3) about tankgame HOT 5 CLOSED

konkit avatar konkit commented on August 15, 2024
Shooting (3)

from tankgame.

Comments (5)

konkit avatar konkit commented on August 15, 2024

Estimation (3)

from tankgame.

raddyr avatar raddyr commented on August 15, 2024

To handle shooting, we need to get 2D vectors (with start_point and collision_point).

from tankgame.

slakomy avatar slakomy commented on August 15, 2024

@raddyr Could you please explain more? I don't get the idea. Isn't it enough if front-end sends information about new shot to backend and backend sends information about positions and directions of missles as well as position of collisions that occured in current time step?

from tankgame.

raddyr avatar raddyr commented on August 15, 2024

Thats correct, frontend sends only information about shot (occurrence) and back-end will calculate trajectory from position and angles. The idea is that the backend will response the start point (simply: actual tank position - it is nice to have to maintain consistency) and end point where bullet disappears (due to collision or max bullet range). We assume that velocity of bullet is constant, so there are no need to send position of bullet every time step.

from tankgame.

tep-pl avatar tep-pl commented on August 15, 2024

Ready to test with frontend.
Listening on 'shoot' channel for:
{ x: MISSILE_INITIAL_X, y: MISSILE_INITIAL_Y, angle: ANGLE_TOWARDS_X_AXIS }

Sending responses to 'missile shot' channel with:
{ ownerId: OWNER_ID, initialPosition: { x: MISSILE_INITIAL_X, y: MISSILE_INITIAL_Y }, target: TARGET_PLAYER | undefined }

EDIT (after some discussion):
Target would be always defined as point (dependend on max missile's scope in case of collision lack)

from tankgame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.