Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
gdevelop5:tutorials:tank-shooter [2018/12/11 09:44]
4ian [Enemy AI]
gdevelop5:tutorials:tank-shooter [2019/02/01 02:03] (current)
4ian
Line 198: Line 198:
 Close the window and apply the changes. Close the window and apply the changes.
  
-The only thing is left to do is to tell GDevelop to fire the bullets from the "​Canon"​ point of the "​turret"​ object. So in our "​create bullet"​ action, we need to change turret.X() and turret.Y() expressions,​ to turret.PointX(Canon) and turret.PointY(Canon). We can change them by clicking the expressions inside the editor.+The only thing is left to do is to tell GDevelop to fire the bullets from the "​Canon"​ point of the "​turret"​ object. So in our "​create bullet"​ action, we need to change turret.X() and turret.Y() expressions,​ to `turret.PointX("Canon")and `turret.PointY("Canon")`. We can change them by clicking the expressions inside the editor.
 {{ :​gdevelop5:​tutorials:​replace-expression-in-editor.png?​nolink&​500 |}} {{ :​gdevelop5:​tutorials:​replace-expression-in-editor.png?​nolink&​500 |}}
 //​Don'​t forget the capital C in Canon as the name of the points are case sensitive.//​ //​Don'​t forget the capital C in Canon as the name of the points are case sensitive.//​
Line 291: Line 291:
 {{ :​gdevelop5:​tutorials:​change-origin-point-position.png?​nolink |}} {{ :​gdevelop5:​tutorials:​change-origin-point-position.png?​nolink |}}
  
-Finally, instead of creating the "​explosion"​ object at the "​Origin"​ point of the "​enemy",​ it is necessary to create the object at the Centre Point. Change the expression in the create explosion action from enemy.X() to enemy.PointX(Centre) and form enemy.Y() to enemy.PointY(Centre)+Finally, instead of creating the "​explosion"​ object at the "​Origin"​ point of the "​enemy",​ it is necessary to create the object at the Centre Point. Change the expression in the create explosion action from `enemy.X()to `enemy.PointX("Centre")and from `enemy.Y()to `enemy.PointY("Centre")`
 {{ :​gdevelop5:​tutorials:​create-explosion-new-expression.png?​nolink |}} {{ :​gdevelop5:​tutorials:​create-explosion-new-expression.png?​nolink |}}