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.

[re-opened] Now picture #5 between player and map.

The question is complicated, the answer might simple?
I really have no clue.


What I'm asking is this:

I want to make a picture a map. To define where the player is able to walk I use 'dummy tiles'.
This can already be performed, but then only by a certain picture.
You have to set it as a background to do this.
I want to make the background move, overlap with other pieces, and be a bit interactive.
I want to have total freedom in the background.
I want to have the events and stuff still be in place, and be seen, if I put a picture on display as #1, #2, #3, and #4.
Maybe the answer is to change the z-values of pictures number 1,2,3 and 4 to something lower than the event's z-values?

I hope someone is able to help me with this.

This question appeared to be somewhat vague, so let me try it again in one sentence:

I would like to know in what way I can locate Pictures #1, #2, #3 and #4 under the map, but above the background?

Thanks in advance,

Tomas
 
Ok, to answer your new question...

edit near line 45 in Spriteset_Map to look like...

Code:
    @picture_sprites = []
    for i in 1..4
      @picture_sprites.push(Sprite_Picture.new(@viewport1,
        $game_screen.pictures[i]))
    end
    for i in 5..50
      @picture_sprites.push(Sprite_Picture.new(@viewport2,
        $game_screen.pictures[i]))
    end

Then, to force pictures 1-4 below the map tiles, edit Sprite_Picture, line 62
Code:
    self.z = @picture.number - 10

By default, the pictures are in @viewport2, with a z value of @picture number
map tiles are in @viewport1, with a z value of (MAPY * 32) + (Priority * 32),
so they have a z range of [0..16160]
So, we force pictures 1-4 into @viewport1, and drop the z value by at least 5 (I used 10)

However, your solution (draw pics 1-4 behind the map) doesn't quite solve your initial problem (use pictures for map graphics).
Pictures are drawn on the Screen, so they won't move with the map.

I gotta go work. Anyone have a solution for making pictures 1-4 move with the map.
Or a different approach altogether (Use sprites with fixed map positions)
If not, I'll take another look at it later.

Be Well
 
You are my hero. :]
I shall attempt to try this.

Brewmeister":8chquvbs said:
However, your solution (draw pics 1-4 behind the map) doesn't quite solve your initial problem (use pictures for map graphics).
Pictures are drawn on the Screen, so they won't move with the map.

I have already taken this into consideration, and have previously decided to make only 20x15 maps.
That'll solve that.

The reason for my request is that I use half-transparent tiles, and I wanted to spice up the background. :]
My question has been resolved, many thanks!

Edit:
I just tried it.
I am Well.
 
Hello, yes, another question that had to do with this.
I'm very pleased with the outcome of the previous, but how would I go on about making picture #5 between the map and the player?
I suppose it'd utilize the same method as displayed earlier, but I can't figure out how.

Thanks in advance,

Tomas
 

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