Comments (5)
Estimation (3)
from tankgame.
To handle shooting, we need to get 2D vectors (with start_point and collision_point).
from tankgame.
@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.
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.
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)
- Handling player movement events (3) HOT 2
- World update (3) HOT 1
- Handle collisions
- Handle coliding objects HOT 1
- Tanks cant be controlled with WSAD
- Fix code formatting
- Problem with turrets disconecting from the tank's body HOT 3
- Handle disconnected players
- Display user's name
- Event naming convention
- Problem with collision bullet->tank HOT 1
- Names not displayed - always 'no name'
- Emit an event to destroyed player HOT 1
- Handle on destroy event in front-end HOT 1
- Server should generate position of new player
- Synchronize bullet speed on frontend and backend HOT 2
- CORS issue HOT 2
- Deploy app to heroku HOT 1
- Player has 3 lifes HOT 1
- Healthbar colors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tankgame.