Coder Social home page Coder Social logo

Comments (6)

VedVid avatar VedVid commented on June 25, 2024

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.

from rawig.

VedVid avatar VedVid commented on June 25, 2024

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

from rawig.

VedVid avatar VedVid commented on June 25, 2024

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

from rawig.

VedVid avatar VedVid commented on June 25, 2024

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

from rawig.

VedVid avatar VedVid commented on June 25, 2024

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

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

from rawig.

VedVid avatar VedVid commented on June 25, 2024

Fixed by 75b954b

from rawig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.