C
C#

help

❔ Removing items from a XAML window

CClara11/29/2022
I'm working on a small video game that I'm visualising with WPF. The issue I have is that I can't quite figure out how to remove an entity from the window. For example, I have a little wizard, who shoots fireballs and I'd like those fireballs to disappear when the hit something.
MainWindow.worldEntityList.Remove(this)
MainWindow.worldEntityList.Remove(this)
hasn't really been doing the trick. I've tested a few things and can confirm that the fireballs are aware they've hit something (they deal damage to the enemies' healthbars), but I can't get rid of them. Or the enemies when they drop to 0hp, for that matter. Any clues you might be able to give me would be very much appreciated.
AAccord11/30/2022
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.

Looking for more? Join the community!