Comments (9)
Hell, just compute both and always use the smaller.
from ninjanode.
That would probably be how it works anyways. Of course, the arrow would be blinking red, and there would be no one to see there. Wraparound right now is pretty cheap in that as soon as the ship passes the border, it's transported. Meaning you can't see or shoot them. This is why I was hoping people would just stay away form the borders, it becomes a far trickier problem if you expect the system to work the same regardless of position.
from ninjanode.
How about if you duplicate an average screen's width of map outside each wraparound point?
from ninjanode.
So.. that would duplicate all ships and projectiles in that range to be at both positions? The mind boggles. 👀
from ninjanode.
There is more than one border.
from ninjanode.
4 to be precise. I did something similar to this in an earlier iteration (Click and move ship). When going off the edge of the screen, a "shadow" copy was made on the exiting side, and kept there until the ship had made it through to the other side. This of course required that the ship be cut in half, and there be two ship entities.
The only reason I'm against it in general is because it feels dirty to have shadow elements that must be managed in a very different fashion, but I guess this is really just a necessary evil when dealing with wrapping
from ninjanode.
This is the intersection of gaming and Cartesian geometry. An equation is
likely researchable.
from ninjanode.
Your other option is to have a moving origin relative to each player, a 20,000x20,000 window that moves with the player and on which all necessary object locations are computed mathematically, to point at. Then worry about drawing them only when the viewport intersects with them.
from ninjanode.
That has been a semi-planned iteration for the sake of game compression. Massively Multiplayer Online Games use a similar approach: Anything that's too far away to see or hear in your vast world will simply not be sent to you. Currently the system (or client systems) could be brought to their knees just by dealing with the number of entities being created so far off screen they wouldn't ever see them.
Though I fail to see how this properly deals with the wraparound. If we're keeping people from getting too far away, we have to keep their relative position correct according to others, while making their absolute position stable
from ninjanode.
Related Issues (20)
- Power Up: Ghost / Cloaking HOT 1
- Warp: Ship ability
- Warning Claxons: Low shields or lots of damage HOT 3
- Rapid acceleration/deceleration when moving horizontally or diagonally HOT 1
- Mines: Permanence? HOT 1
- Mines: Magnetic?
- New Weapon: Slow gun
- Mines: Colors
- Map Edge Wrapping - a plausible solution?
- New Weapon/Powerup: Turrets
- New Weapon/Powerup: Warp mines!
- Ping registered users to play
- Home Planets / Spheres of Influence
- Emergency Distress Beacon
- Bug: Thrust sound stays on HOT 1
- Instant Replays HOT 1
- Screen shakes when hit HOT 1
- Volume adjustments!!!
- Could this be made into a "3D" game?! HOT 3
- New Ship Icons: Ability to upload a ship HOT 4
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 ninjanode.