Results 1 to 4 of 4

Thread: Help!!!! --> Tiles

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    Angry Help!!!! --> Tiles

    Tiles and Blocking
    Hello Every1,

    I am currently building my first game and have run into some pretty simple, but killer problems. Here goes...

    Here is the example that I got my tile engine from...
    here's the engine

    My questions are:
    1) how can I keep my character (sprite) in the center of the map
    2) how can I make the map move according to keyboard commands

    I know how to move an object with the keyboard, but this seems to be a totally different story...


    Thanx for any help,
    Squirrelly1
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

  2. #2
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    That's easy!

    When you press the arrow keys, move the screen AND change the playerX/Y variables accordingly (of course you can't move the screen when it's already in the edge :P )

    Try it, it'll work. You'll also have much simplier code than Fox's demonstration

    And load your map from a file. You'll have to make a simple map editor too, but it's worth it
    (Most people hard-code the tiles into the game, but that's not very good)
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Try it, it'll work. You'll also have much simplier code than Fox's demonstration


    (this is from my tutorial)

  4. #4
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Heh well, it's just that this way you don't have to check if the player has reached the edge of the screen to move it
    (Because it seems that a lot of people who are new to this kind of stuff don't like collision detection and stuff like this )
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

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