Results 1 to 6 of 6

Thread: direct draw background scrolling(for a game)

  1. #1

    Thread Starter
    New Member voidwalker's Avatar
    Join Date
    Nov 2001
    Posts
    8

    direct draw background scrolling(for a game)

    Hi there,
    I´ve a little problem with DD.
    I want to make a game (like Diablo) and I´ve some problems with the background scrolling in DD.
    I know how to scroll to one side but I`ve some problems to do it diagonal (two sides at the same time). Could anybody help me?

    voidwalker

    PS:
    Sorry, but I´ve forgotten to mention that I can´t use wide surfaces. This is the reason why I have to do it this way.
    Last edited by voidwalker; Dec 22nd, 2001 at 10:34 AM.

  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
    To scroll diagonally up and left, just scroll up and then left

    It's a tile engine, right? How are you doing the scrolling?
    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

    Thread Starter
    New Member voidwalker's Avatar
    Join Date
    Nov 2001
    Posts
    8
    The scrolling in one direction is not so complicated. I´ve got the idea from the dx4vb site.
    You just use a second rect and blit the first a little bit smaller and on the rest of your monitor you blit the second rect.
    My problem is how do you handle the rects for two directions at the same time?

    voidwalker

    PS:
    My original background is bigger than the screen and I divided it into several pictures (800x600).

  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


    Now you got me confused... can you please explain what you're doing a bit better?
    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."

  5. #5

    Thread Starter
    New Member voidwalker's Avatar
    Join Date
    Nov 2001
    Posts
    8
    Sorry

    OK, imagine you have a picture (2400 x 1800 px), the background.
    Many computers don´t support wide surfaces, like mine.
    I divide the big picture (2400x1800) in small pictures (800x600) which my computer can display.
    In DD I have a rect with the first picture(a which is blitted on my monitor.
    I´ve mentioned before that I use the tutorial from dx4vb as a base for my scrolling engine.
    Imagine the avatar moves left so I have to scroll to the left:
    I have a in my first rect (top=0,left=0,width=800,height=600).
    Then I blit my second rect (top=0,left=xyz,width=800-xyz,height=600), with picture b in a loop on the screen.

    If this explanation is also confusing to you, then please look up the tutorial from Jack Hoxley (link ^^^).

    voidwalker

  6. #6
    Lively Member ice & fire's Avatar
    Join Date
    Oct 2001
    Location
    Land of ice & fire
    Posts
    110
    You don´t get along with it, do you?

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