Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Resolution

I've seen that on XP too. You changed the Viewports size to 640x480, right? Then I guess the problem is in Game_Map, mainly.
You'll have to change a couple of values under def update_scroll
 

bukai

Member

hey. thanks for your reply.

well, l tried to change the distance. (2 replaced with 1 or 3...)
Code:
  #--------------------------------------------------------------------------
  # * Update Scroll
  #--------------------------------------------------------------------------
  def update_scroll
    if @scroll_rest > 0                 # If scrolling
      distance = 2 ** @scroll_speed     # Convert to distance
      case @scroll_direction
      when 2  # Down
        scroll_down(distance)
      when 4  # Left
        scroll_left(distance)
      when 6  # Right
        scroll_right(distance)
      when 8  # Up
        scroll_up(distance)
      end
      @scroll_rest -= distance          # Subtract scrolled distance
    end
  end

but i coudln't notice any difference :(

here is another screen. from a big map.
only the right and bottom side 'aren't working as intended'!
screen right: http://www.bilder-space.de/show.php?fil ... u30B8D.JPG
screen bottom: http://www.bilder-space.de/show.php?fil ... J7bf9o.JPG
the red line marks 'what shoudln't be there'. l can't even move there. (screen right)
If anyone want l will upload a demo.
 

bukai

Member

hey!
l solved the problem!
you have to change in Game_Map setup_scroll
Code:
    @margin_x = (width - 17) * 256 / 2      # Screen non-display width /2
    @margin_y = (height - 13) * 256 / 2     # Screen non-display height /2

to this
Code:
    @margin_x = (width - 20) * 256 / 2      # Screen non-display width /2
    @margin_y = (height - 15) * 256 / 2     # Screen non-display height /2

and do the same for scroll_down and scroll_right.

all your maps, have to be 20x15 or bigger.
otherwise you will get trouble.

so long
 
Yes, that's what I said :)
Dargor":clj5i58g said:
[...]in Game_Map, mainly.
You'll have to change a couple of values under def update_scroll

If you want to get further with that, you could also try to make this compatible with any screen size.

Instead of giving the script a precise value (like 17x13 or 20x15) you can take the screen's width and height and divide them by 32. By doing so, you will get the width and height of the screen in tiles and wouldn't need to put a specific value every time you change the resolution.

EDIT:
Sorry not update_scroll, setup_scroll, my mistake.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top