How to show a projectile hitting a wall in app designer

조회 수: 2 (최근 30일)
Anon
Anon 2020년 12월 22일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by