Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear tiles under objects / creatures / etc #23

Closed
VedVid opened this issue Oct 21, 2018 · 6 comments
Closed

Clear tiles under objects / creatures / etc #23

VedVid opened this issue Oct 21, 2018 · 6 comments
Labels
enhancement New feature or request low [priority]

Comments

@VedVid
Copy link
Owner

VedVid commented Oct 21, 2018

No description provided.

@VedVid
Copy link
Owner Author

VedVid commented Nov 14, 2018

I'd like to make it in such a simple way:

func PrintObjects(b Board, o Objects, c Creatures) {
	for _, v := range o {
		if (IsInFOV(b, c[0].X, c[0].Y, v.X, v.Y) == true) ||
			(v.AlwaysVisible == true) {
			for l := BaseLayer; l < v.Layer; l++ {
				blt.Layer(l)
				blt.ClearArea(v.X, v.Y, 1, 1)
			}
			blt.Layer(v.Layer)
			glyph := "[color=" + v.Color + "]" + v.Char
			blt.Print(v.X, v.Y, glyph)
		}
	}
}

so, just clear tiles under specific entity. But the problem is that player is always first element of slice, so creatures with layers smaller than player are printed after him.

VedVid added a commit that referenced this issue Nov 14, 2018
…yer won't be displayed under ones with bigger Layer (like corpses under player); it's not elegant solution, thought
@VedVid
Copy link
Owner Author

VedVid commented Nov 14, 2018

Fixed by 667b9d0 It's not elegant solution, thought :(

@VedVid VedVid closed this as completed Nov 14, 2018
@VedVid VedVid reopened this Nov 14, 2018
@VedVid
Copy link
Owner Author

VedVid commented Nov 14, 2018

It's still an issue, because Creatures' corpses will be rendered under, for example, objects.

@VedVid
Copy link
Owner Author

VedVid commented Nov 14, 2018

I'm leaving rendering system as it was before changes until I'll figure out how to fix it properly.

VedVid added a commit that referenced this issue Nov 14, 2018
…aller Layer won't be displayed under ones with bigger Layer (like corpses under player); it's not elegant solution, thought"

This reverts commit 667b9d0.
@VedVid VedVid added low [priority] and removed medium [priority] labels Dec 14, 2018
@VedVid
Copy link
Owner Author

VedVid commented Dec 14, 2018

I think that it will be "hacked" in proper games.

It would be nice to have proper, universal solution in RAWIG as well.

@VedVid
Copy link
Owner Author

VedVid commented Feb 26, 2022

Fixed by 75b954b

@VedVid VedVid closed this as completed Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low [priority]
Projects
None yet
Development

No branches or pull requests

1 participant