Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

TankWars remove the hitfield from the enviroment?

$
0
0

Hello,

im trying to make a simple as possible TankWars game. I have already hit some problems.

Now i start a animation on the scale property of the bullet ellipse from scaleX/Y 1 to 5 when it hits my terrain path. (its a green meadow at the bottom of the screen). So now i would like to remove the space that the bullet hits after explosion. The half of the ellipse is over the path(terrain). The path should now be changed so it looks like the explosion destroyed that part of the terrain.

Maybe using path for the terrain is no the right way. Or i need to define a dynamic path that have a segment for every pixel?

Someone have a tip how i can solve the problem?

<Canvas><Path Stroke="GreenYellow" StrokeThickness="4" Fill="DarkGreen" FlowDirection="LeftToRight" x:Name="path_terrain"><Path.Data><PathGeometry><PathGeometry.Figures><PathFigureCollection><PathFigure StartPoint="0,768"><PathFigure.Segments><PathSegmentCollection><QuadraticBezierSegment Point1="0,600" Point2="0,600" /><QuadraticBezierSegment Point1="200,550" Point2="350,600" /><QuadraticBezierSegment Point1="350,600" Point2="500,600" /><QuadraticBezierSegment Point1="500,400" Point2="700,500" /><QuadraticBezierSegment Point1="700,400" Point2="900,600" /><QuadraticBezierSegment Point1="900,600" Point2="1100,500" /><QuadraticBezierSegment Point1="1200,400" Point2="1366,550" /><QuadraticBezierSegment Point1="1366,768" Point2="1366,768" /></PathSegmentCollection></PathFigure.Segments></PathFigure></PathFigureCollection></PathGeometry.Figures></PathGeometry></Path.Data></Path><Ellipse x:Name="bullet" Width="30" Height="30" Fill="Black" Stroke="Red" StrokeThickness="1" Canvas.Left="-100" Canvas.Top="50" Margin="0"></Ellipse></Canvas>

Thank you.


tu es, oder lass es


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>