Results 1 to 5 of 5

Thread: Move Image in restricted field

  1. #1

    Thread Starter
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Move Image in restricted field

    Hi,

    I have map and a player (I am reffering to bitblt game which i have posted earlier in this forum)

    I want the user to be restricted from running over water etc etc.

    Could anybody pop up some idea's.

    Thanks,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Sorry I didn't watch your post but here's the theory:

    In your map (or in the tiles) store a value Walkable (or Collision if you prefer) and when moving the player check the target position if it's allowed to walk there. If the player position is in pixel you have to divide it to get the map position, something like this:

    VB Code:
    1. If Tile( Map( player.x / 16, player.y / 16 ) ).Collision then
    2.     'Reject movement
    3. Endif

    Btw: Thanks for remembering me, I'll write a tutorial about this when I'm done with the tiles one.

  3. #3

    Thread Starter
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hae Thankx

    Well my game has a static background..

    Well i found an example by cyborg in this forum.. I have done a map editor.. i am now redesigning the game..

    Thankx..

    Let me know once your article is ready..
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  4. #4

    Thread Starter
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Fox,

    I have made a tile game as you mentioned in yesterdays thread..

    I am not loading the BMPs at runtime..

    This is what i have done..

    Create a Map using my own editor
    and save it as a whole BMP also save a txt file with the tile numbers..


    Map

    +------+------+------+
    | | | |
    | 5 | 1 | 2 |
    +------+------+------+
    | | | |
    | 3 | 6 | 5 |
    +------+------+------+
    | | | |
    | 6 | 1 | 8 |
    +------+------+------+

    Txt file

    5
    1
    2
    3
    6
    5
    6
    1
    8

    Where the numbers corresponds to the tile numbers..

    Now i load this file in my game and the background still
    remains static.

    I know the restrictions for my users and thus my game goes..

    find it at

    Here

    I will read your tutorial now.. It looks very Good..
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  5. #5
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    You're not suppose to save the map as a bitmap... and about saving the files, I'll update the site today and add another tutorial showing you how to save/load binary files. Well keep reading anyways, it shows you how to implement a virtual camera you can move around your map and even how to animate tiles.

Posting Permissions

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



Click Here to Expand Forum to Full Width