Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sep 10 17:54:45 <smc_gamer> Well, let's see...
- Sep 10 17:55:26 <smc_gamer> For now, my plans for collision detection will be to split the level up into chunks and check sprites against chunks first, then objects inside the chunk.
- Sep 10 17:56:40 <smc_gamer> Physics will probably be simple; momentum is calculated in pixels per frame.
- Sep 10 17:57:08 <smc_gamer> Chunk collision testing will also have to check whether a sprite is near an object, too.
- Sep 10 17:57:37 <smc_gamer> If you're heading at five pixel per frame, and you're four pixels from a block, next frame you'll go in the block, which looks pretty choppy.
- Sep 10 17:57:46 * reghrhre has quit (Ping timeout: 264 seconds)
- Sep 10 17:58:25 <smc_gamer> So the collision check will also have to check pixel near sprites at the sprites speed, but that shouldn't be too much of a performance problem.
- Sep 10 17:58:56 <smc_gamer> As for blocks, there are only a few types of block behavior (solid, platform, itembox, etc.)
- Sep 10 17:59:16 <smc_gamer> So, instead of coding every single block, we could code a few types and then just reskin the others as necessary.
- Sep 10 17:59:43 <Joey> Sounds good.
- Sep 10 17:59:52 <smc_gamer> SolidBlock could probably handle 85% of all blocks we need to put in, but a few of the more advanced blocks (switch blocks, etc.) will have to have their own classes.
- Sep 10 18:00:33 <smc_gamer> Each block will have its own internal settings file, like SMBX's, but it will be overrided if the game finds another settings file.
- Sep 10 18:00:47 <smc_gamer> Each file defines things like hitbox, size, animation, etc.
- Sep 10 18:01:13 <smc_gamer> Sprites will be implemented as a simple group.
- Sep 10 18:01:50 <smc_gamer> I don't have all the kinks worked out of this idea, but I think I can make sprites inherit from a core Sprite class, and only override what needs overriding (behavior, primarily).
- Sep 10 18:02:10 <smc_gamer> This could also make it easy to index them, which is essential for fast updates.
- Sep 10 18:02:24 <Joey> Hm.
- Sep 10 18:02:44 <smc_gamer> All sprites would update on an update loop every frame.
- Sep 10 18:02:57 <smc_gamer> I think an array or Collection will suffice for sprite groups.
- Sep 10 18:03:18 <smc_gamer> Each sprite and block will have a static ID and an "live" ID, too.
- Sep 10 18:03:32 <smc_gamer> The static ID would be like SMBX's block-1, block-2, etc.
- Sep 10 18:04:01 <smc_gamer> The live ID is assigned real-time, and will be used to reference individual sprites and blocks.
- Sep 10 18:04:19 <Joey> Sounds cool.
- Sep 10 18:04:29 <smc_gamer> Live IDs would then be stored in the level file, and new blocks and sprites will be appended to the end of the file when added.
- Sep 10 18:04:32 <smc_gamer> </infodump>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement