Results 1 to 10 of 45

Thread: Super Heli Land

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Great! Another Allegro.pas project. I'm sooooooo happy!
    No signature provided yet.

  2. #2
    Update: Currently figuring out world generator. I don't know how to make blocks appear on ground and not get buried (think way grass in Terraria is outside, but never inside of dirt). It is important, because I want to add some spikes here and there and those won't look good in mid-air or inside of ground.

    Next on: State machine.

    //edit: Also it is amazing, how much randomly plotted circles can do to generate cool cave.
    Last edited by Darkhog; 29-05-2013 at 12:04 PM.

  3. #3
    Project update: Started to move world generator stuff into it's own class and unit. I think I'll leave state machine for end.

    Next on: Figuring out how to make collision with map (probably I'll use my custom TSprite class for that).

  4. #4
    I've figured out way to make sprite collisions. As I suspected, I'll use my TSprite class for that. Will need two sprites per chunk (one for blocks that just stop player and one for blocks that hurts him, like spikes) plus array of sprites for shootable blocks (will need to check for collision between bullet and any of those so I can remove them).

    I've almost finished world generator. After I'll finish it completely I'll get to tileset stuff (such as rendering chunks to sprite objects and getting tile with specific ID from tileset).

  5. #5
    Quote Originally Posted by Darkhog View Post
    I've figured out way to make sprite collisions. As I suspected, I'll use my TSprite class for that. Will need two sprites per chunk (one for blocks that just stop player and one for blocks that hurts him, like spikes) plus array of sprites for shootable blocks (will need to check for collision between bullet and any of those so I can remove them).
    Why needing two sprites per chunk. Wouldn't it be better to just include additional information to a single sprite which would tell you what type it is.
    At some point your would probably decide to include some AI controlled units. So would you use even more spites to determine their behaviro?

    I belive it would be better to just derive the base sprite clss and add aditional information to it like is pasable, can be destroyed, its health, how much damage does it do. Combination of theese can be for instance even used for defining wall which would deal damage to the player oif it bumps into (spiked walls).

  6. #6
    Problem is that when checking for collision with one sprite (it's pixel-perfect by the way) I can't tell if part of sprite player is colliding with is spike or harmless object, hence two sprites per chunk - one for harmful things and other for harmless. Supposedly I could do like you are saying, but I'm too much of a n00b yet and I'm basically learning Allegro with this project so...

    Also you are talking to guy who barely made world generation and pixel-perfect collision and only because I was given perlin noise unit and was able to (barely) translate pixel-perfect collision code for original Allegro (in C).

  7. #7
    Good news: World generator doesn't crash game (it did, but I got rid of the problem).

    Bad news: It looks awful (fails to generate ground and traps. Will be posting help request thread in a minute.

  8. #8
    Quote Originally Posted by Darkhog View Post
    Problem is that when checking for collision with one sprite (it's pixel-perfect by the way) I can't tell if part of sprite player is colliding with is spike or harmless object, hence two sprites per chunk - one for harmful things and other for harmless. Supposedly I could do like you are saying, but I'm too much of a n00b yet and I'm basically learning Allegro with this project so...
    collision sprite could have one color for marking harmful area and second for non-harmful, other colors could be also used if needed for other properties like bumpiness. This could be broken down to using one color channel for harmufulness and other for bumpiness to allow both on same surface
    I think this info could be also encoded directly into single sprite image with some work.

  9. #9
    Quote Originally Posted by Darkhog View Post
    Problem is that when checking for collision with one sprite (it's pixel-perfect by the way) I can't tell if part of sprite player is colliding with is spike or harmless object, hence two sprites per chunk - one for harmful things and other for harmless. Supposedly I could do like you are saying, but I'm too much of a n00b yet and I'm basically learning Allegro with this project so...
    How big are your sprites? Are you using one sprite for whole map section?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •