Clear Filters
Clear Filters

How to show a projectile hitting a wall in app designer

2 views (last 30 days)
i currently have code for a projectile and for an obstacle to appear. How would i show the projectile hitting the obstacle and then falling down at the place of hitting it? this is also one of two conditions so how should i go about separating these? im thinking to use a for loop where i use the values for obstacle height and distance to, to determine whether the obstacle condition is running?
Currently this the code for plotting:
Ox = app.DistancetothewallobstaclefromlaunchEditField.Value
Oy = app.ObstacleheightEditField.Value
Ot = (app.ObstaclethicknessSlider.Value)/100
rectangle(app.Graph,'Position',[Ox 0 Ot Oy],'FaceColor',[0.6353 0.0784 0.1843]) %obstacle plot
hold(app.Graph,'on')
comet(app.Graph,x,y,0.1) %projectile plot

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!