Open zombiecalypse opened 11 years ago
The path finding needs to be implemented in the movers trait. But how can the trait access the mask? Which is needed for the path finding for obvious reasons.
parent.blocked?
should do the job I think
I mean like, the whole map
Yeah, what else would it do? Oo => parent.blocked? x,y
, uses Level#blocked?, which uses Map#blocked?
Ok, I will build my own map then. Why is it parent.blocked? x,y
and not just blocked? x,y
?
huh? what did you have in mind, that you need to build a new map for that?
parent
gives the game state in which the object was created - every movable thing should have a Level
there. There is no reason, why you shouldn't implement
def blocked x,y
parent.blocked? x,y
end
Yep, I had a confusion about parent
and super
. Anyway, there is already a method
def blocked? x,y
self.instance_exec(x,y, &blocked_block) if blocked_block
end
Is that not doing the same?
Ah, yes, I remember! That one is for the case that the guy is not only blocked by the surroundings, but also e.g. by other units. Do you think, the path finding should take that into account?
It works now but really slowly, like 20 secs per enemy.... but it feels longer
fitting: my tilemaps are really slow for big levels too ;) On Jan 9, 2013 3:52 PM, "Blue-Robot" notifications@github.com wrote:
It works now but really slowly, like 20 secs.... but it feels longer
— Reply to this email directly or view it on GitHubhttps://github.com/zombiecalypse/Game-Design-Project/issues/20#issuecomment-12047353.
I guess we'll talk tomorrow about optimization
I developed a three point program to optimize this:
So far
We need to find a path finding algorithm, that operates on our potentially continuous map