ArticlesBlog

ADDING A DRIVER IN GDEVELOP 5 PHYSICS CAR BASED GAME

ADDING A DRIVER IN GDEVELOP 5 PHYSICS CAR BASED GAME


hello and welcome in this video I’m
going to show you how to add a driver to your car based game in gdevelop so
right here you can see I have a driver in the window of my car I’m going to
show you how to get that done whoa my car is upside down and my driver is also out of
my car so I’m going to quit my game and then
the first thing you need to do in order to get this done is to add your driver
you don’t want the full body of your driver you just need the head just to
show that someone is in your car so I’m going to delete my driver and I’m going
to re-add my driver once again just to get you through how to do that
with your game so I’m going to click right here on add a new object and then
I’m going to click on sprite I’ll click on add an animation and click on add and
then I’m going to pick up my driver sprite or the head of my driver and
click on open in my object name I’m going to call my object as driver so i will
type in driver which I have and click on apply after I’m done with this
I want my driver to be created at the position of my car so I’ll get into my
car by clicking on these three dots and click on edit object once I open my
window I’ll click on edit points and I’m going to add a new point by clicking
right here my plus sign and type pospoint which I already have on top
pospoint so I’ll delete the first one just so that I can have a new
point so i have a new pospoint and then I’m going to set my X axis to that of a
100 so I’ll have my axis created on top here so I’ll drag it to the position I
want my player to be created and that is in the window of my car so right here
should be okay on top I’m going to leave the position here so you realize I have
a new X and Y axis points I’m not going to need that I just
need the name so pospoint is okay I’ll click on close and then I’ll click
on apply with this done or get into my scene events
and add some events I’m going to add a sub event to that off at the beginning
of my scene because I want my events to take place at the beginning of my scene
so once I get that done I’m going to click on add condition and type in my
search panel trigger once while true and click on OK the next thing I’m going to
do is click on add action in my search panel i will type create and click on create an object object to create is going to be my driver so i will type driver and the x
position is going to be car dot X into bracket and then I’m going to type in
the name of my point which is pospoint and I’ll do the same thing for my Y
position so car dot Y into bracket pospoint and then I’ll click on okay so now I can
have my driver created at the position I want it to be created the next thing
I’m going to do is to add Z order if you’ve not checked out my video on Z
order you should because Z order is very important in gdevelop and it will help
you clarify a lot of things and understand the game engine much more
better so I’m going to type in my search panel Z order I’ll click on Z order
and the object is going to be my driver obviously I’ll click on driver my
modification sign is going to be set to an equal to and the value is going to be
anything lesser than that of my car so my Z order is 2 this will send my driver
behind my car so you should take notice I’ll click on add action
and in my search panel the next thing I want to do is to set my width and height
so type width and then I’ll click on width my object is going to be my driver I’ll set my modification sign to equal
to and the value is going to be 20 and click on OK I’ll do the same thing for
that of my height so I’ll click on add action in my search panel type in height
click on height and my object is going to be my driver once again the modification
sign is going to be set to an equal to and the value is also going to be a 20
and i will click on OK with this done I have everything needed to create my
driver to set my driver and also to resize my driver now I want to position
my driver so I’m going to click on add a new empty event and I don’t want my
event as a sub event I want it as an actual event on its own so i will drag it a
little bit so that is in line with the rest of my events and then I’m going to
add action in my search panel I’m going to type position and click on position of
an object my object right here is going to be my driver obviously the modification
sign is going to be set to an equal to the position is going to be car dot
point X into bracket and I’m going to type pospoint so that is the exact position
my player was created car dot y for my Y position sorry point Y into bracket pospoint and I’ll click on OK so this is it and it should work so I’ll get
back into my new scene and click on launch okay
so you can see my driver in there so yes it worked and I can go and have a feel
at how everything is check out the rest of my other videos

Comment here