This method is what I am trying achieve with my project , an object off the screen moves towards one of many (randomly) objects that are already on the screen,
The tuturial states that the method in question in under All Objects → Displacement ->Move an object towards another.
Firstly displacement is not in the list of options and when I do find similar methods to Move an object towards another they do not have the length in pixels setting.
Those move towards another that I have found, I have tried and cannot see to get them to work.
** EDIT 1 **
found the setting now , I was being stupid, however , I still need to be able to get the first object to move towards one of these other objects randomly. The second object (the target) currently has repeated itself across the screen and so the first object (enemy) needs to randomly pick one of these.
** EDIT 2 **
okay so I have got the object to move towards the target , however when this happens the enemy objects seems to be stretching towards the target . How do I make the object move towards the target instead of it stretching or it appears to be copying itself over and over until it reaches the target.
Still struggling with this one, so if anyone could point me in the right direction on what I am doing wrong with why this object is not moving as such or it is but leaving its movement in a kind of trail .
On looking at this , I think the issue is that I have duplicated the same object across the screen (the target) and then this may have confused how the enemy is moving towards this target.
Instead, can Gdevelop use arrays to store an object. So that the same object is contained in a different index of the array . I have read that GDevelop has structures which from reading about this appear to be arrays, however can these hold and access objects?
If this can be done then perhaps the target and enemy would work as each object will be treated as a separate one instead of copies of the same.
As I thought, check the event 2, you are creating an instance “chips” every frame at the same position (0; ScreenHeight), then move every “chips” to some target so you’ll get a trail of “chips”, the firstly created instances will be at the front (they has been moving for a longer time)
Not sure what you’re trying to do, there should be only one “chips” instance?
Hi Lizard-13, I am trying to move an object from off the screen toward one of the target (tooth) objects . On reading one of the tutorials it position the enemy (chips in my case) off screen and then did a move towards action to head towards the target.
this is what I am trying to achieve and as well as moving towards the target I am trying to make the enemy shrink as though it is going into the distance if that is also possible
Hi again Lizard-13 I see now what I have done with this object like you said, as there is no condition for the creation of this object, it continual creates it . I have put a at the start of scene condition in which has stopped this now, however I am finding that the object “chips” when reaching the target appears to be “shaking” and so I tried a stop object movement but this did not work.
Also I am still trying to work out how to send this object to one of the targets randomly. The aim really is for the chips in this case acting as an enemy to attack the target every so often throughout the level so I guess a timer would do that perhaps ?
This will be one of many types of enemies as well so I need to be able to randomly select which ones attack and when and randomly to the targets
Since my last post I have been trying and experimented with various ways of trying to check the enemy object to move toward any one of the target objects that have been displayed across the screen. Sadly I have failed to achieve this and am wondering if it is to do with the way the target objects have been created.
This of course is my fault as in my previous post I did not mention my goal with these objects and so the help I received was only based on the information I provided.
Is there a way of dynamically created the target object across the screen but give each newly created object an identifier that can be used when the enemy object is set to move towards one randomly ? I did try and use a variable for the target object called name and tried to apply an incremented name for each one but whether that worked or not I could not tell because I then struggled using the move to object event to then refer to one of these
Please advise if what I am trying to do is possible
** EDIT **
Right I think I have worked out the Random part now but I am still getting problem with the object shaking when it reaches the target and does not stop trying to move between the targets there , I have tried a timer and then tried to stop the object movement and delete the timer but this has not worked either. I will continue with this but any help would be appreciated
You have to excuse my questions, I have read the documentation and gone through the tutorials but I learn better as well by trial and error. At the moment I am still trying to get use to how GDevelop works and I really want to understand this program as it looks great.
I am use to programming itself but this is more event driven from what I can tell and I have never done any kind of game making before only application development. This is an area (game making) that I have always wanted to get into and I have looked around , sadly bought one product and feel let down by the developer of that product who seems to be the only person knowledgeable enough to answer the questions, but recently has completely stop answering anyones posts not just mine.
So at the moment I get the impression that if there is no condition to an action, this action will continually repeat itself is that right? at the moment I am still trying to get this movement issue sorted out and when the enemy object moves towards its target, it does not appear to stop as such hence the shaking . No matter what I attempt to try , it either does not move, moves then stops before the target or goes back to getting to the target but then just does this hovering or shaking when it reaches the target which means to me that the condition is allowing the enemy to still move.
Please can some point me in the right direction on what I am doing wrong. Again apologise for the stupid questions but this is sadly how I learn
Wait! Please edit your previous messages instead “tetra-posting” , multi-posting is not a good habit (maybe valid to revive post = “up”)
And I’m sorry if it took me a long to reply
Ok, it seems some basic knowledges are missing, so I’ll make a very short summary about how it works, but really I suggest you to read the beginners tutorial: http://www.wiki.compilgames.net/doku.php/gdevelop/tutorials/beginnertutorial2
Your game works at certain amount of FPS (frames per second), the default value is 60. In every frame, GD read and launch every event in the given order, from top to bottom… So, 60 times per second, your events are executed if their conditions are met.
About object selection, the way GD take account some instances (the objects are like templates, then you create instances from those templates to interact in the scene) and doesn’t take others is through the events conditions, if you add the condition “chips collides with platform”, GD will apply the event’s actions over every chip colliding with a platform. Some actions modify the instances being selected, for example the action to create a chip object automatically set the created chip instance as the only one selected.
Now you have solved the problem about creating multiple enemies adding the condition “At the beginning of the scene”, but you could just drag the “chips” object from the right window to the scene to create an instance.
To select your random platform, your solution sounds fine, add an unique ID to each platform, then at the beginning of the scene select a random platform (it will put only one platform as the current selected), and save the platform ID value in a scene variable, finally when you want to move the enemy through this platform, use the condition “Variable ID of Platform is = Variable(SavedPlatformID)” to select this platform for future actions
About forces, you can add a force every frame to move the enemy toward the platform with a damping = 0 (so the force remains only this frame), but only if the distance is bigger than some value, for example 5 pixels, this way when the enemy is at a distance below 5 pixels the force won’t be applied and the enemy will be stopped instead shaking.
You can ask here specific questions, but again I suggests reading the tutorials, or play/modify the examples that comes with GD
Thanks for coming back to me, I apologise for the multiple posts, it was through desperation that I did this, as I was left in the dark from this other program I had spent my hard earn cash on and the developer seems to have abandon the forum altogether .
I am trying to understand your post at the moment so I will recap on what I am trying to achieve , the chips character will be one of may “enemies” that will appear in at a random point off the screen and head towards a “target” which will also be done randomly
So far the target I can get a single instance of the chips character to do this and I understand the concept of FPS (frames per second) but I did not know that this program used that this way. I have gone through the tutorials on this site but I am just following them and really as mentioned before, I only really learn through trial by error (it is sadly the way I am when learning things and I have to say, I wish I could learn the way “other” people do ) . that tutorial you mentioned is the one I have been trying to use as a template for mine but not really working for me.
I also found that I did not need to add a unique id to make the random selection to work as I just went for the pick a random object, selected the name of the target and as this was create multiple times, that worked to an extent but I will try your suggestion on the ID and see where I go.
Any thoughts on why the chips object is “shaking” when it reaches the target ?
Also tried the examples but most of them do not work on the Mac as they are native to Windows/Linux.
** EDIT **
How do i “select” the unique ID from the target after creating it ? I can see how I can assign it to a scene variable then how to I select it and get the enemy to move towards that target ?