Tag Info

New answers tagged

0

http://www.needsmorejquery.com/ Perhaps something like ... HTML: <div data-role="map"> <div data-location="a1" data-role="tile" data-sound="thriller.mp3" /> <div data-location="a2" data-role="tile" data-sound="thriller2.mp3" /> <div data-location="a3" data-role="tile" data-sound="thriller3.mp3" /> ... </div> JS: ...


0

Remember that what you display (or don't display) to the user doesn't have to be the same as the information you keep about the player and the game world. Design your game as if you were to display the player's location on a map, then instead of showing which square they're in, play the sound for the square they're in. That means designing a map and ...


2

This does not necessarily have to be as computationally expensive as you imagine. First of all, as you hinted at, you don't have to check every entity; just the ones that are moving. As such it might be wiser to have individual entities update their grid cell in their update method. As for checking coordinates, there are a few optimizations you could make. ...


5

First of all, unless you have an exorbitant number of entities, assigning them to a sector on every logic frame is most likely performance-wise negligible. That said, it sounds like you are in over your head. Either your game doesn't actually need spatial partitioning, or what you are trying to create is too advanced for your level. The point of spatial ...


2

You don't have to check every entity, every frame. You only have to check entities when you move them. Further, since you're using a grid system, you can just check to see if they've crossed a boundary. For example, if they're currently in grid 5,5 and you have a grid line every 10 units, you only have to do a modulus on their current x and y coordinates ...


1

The frame you're in is irrelevant. You don't do this every frame. When the entity moves just check if it's in a new section and update it as needed.


4

As long as your movement space isn't Euclidean and things can block an entire grid space, you'll have this problem. If you want people to not "play the grid" you're probably going to have to not use a grid.


0

Note: I know nothing of C++, only Java, but you should be able to figure out the code. Physics is universal language right? I also realize this is a year old post, yet I just wanted to share this with everyone. I have an observer pattern that basically, after the entity moves, it returns the object it has collided with, including a NULL object. Simply put: ...



Top 50 recent answers are included