Collision problem

Learn how to start making games.

Collision problem

Postby Kcee » Sat Apr 28, 2018 1:34 pm

What code should I use to change a variable to 0(false) if two actors are not in collision?
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: Collision problem

Postby Kcee » Sat Apr 28, 2018 8:15 pm

Please I really need a reply, I tried using CollisionFree but I don't know much about it.
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: Collision problem

Postby Ehman » Sun Apr 29, 2018 7:07 pm

KCEE PLS. CAN YOU NARRATE YOUR PROBLEM IN A SIMPLER XPRESION
User avatar
Ehman
 
Posts: 186
Joined: Wed Apr 18, 2018 7:56 pm
Location: MonsteRealm
Score: 1 Give a positive score

Re: Collision problem

Postby Kcee » Sun Apr 29, 2018 7:23 pm

Something like: If player actor is not colliding with car actor, touching car=0; Are you familiar with GE?
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: Collision problem

Postby lcl » Mon Apr 30, 2018 7:01 am

Player -> Create Actor -> Script Editor:
Code: Select all
touching_car = 0;

Player -> Collision any side of Car -> Script Editor:
Code: Select all
touching_car = 1;

Player -> Collision Finish with Car -> Script Editor:
Code: Select all
touching_car = 0;
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Collision problem

Postby Kcee » Mon Apr 30, 2018 7:04 am

Thanks lcl, I owe you one.
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: Collision problem

Postby Kcee » Mon Apr 30, 2018 8:08 am

Quick questions: What kind of code should put in draw actor and create actor? And isn't 0 the default number assigned to user variables?
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: Collision problem

Postby lcl » Mon Apr 30, 2018 11:23 am

Draw Actor event occurs when the actor is drawn, i.e. every frame of the game. Gravity code is an example of what should be put to this event.

Create Actor event occurs when the actor is created. This means either when the game starts and the actor is created, or when using Create Actor action to create the actor. Notice that Create Actor event and Create Actor action are different things. The latter one creates actors, while the first is an actor's event that takes place upon the creation of the actor. An example of the usage of the Create Actor event could be setting the xvelocity of a bullet actor.

Yes, global variables and actor variables are automatically initialized to zero. But remember that it doesn't apply to local variables, i.e. variables created inside an event or a function through code.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Collision problem

Postby Kcee » Mon Apr 30, 2018 11:44 am

Thanks a lot!
Currently working on: Super Stick Brawl.
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score

Re: Collision problem

Postby Ehman » Tue May 01, 2018 6:44 am

Kcee wrote:Something like: If player actor is not colliding with car actor, touching car=0; Are you familiar with GE?

uhmmm. Just a little bit but it's not like I can't create games on game editor :D
User avatar
Ehman
 
Posts: 186
Joined: Wed Apr 18, 2018 7:56 pm
Location: MonsteRealm
Score: 1 Give a positive score

Re: Collision problem

Postby Ehman » Tue May 01, 2018 6:46 am

Did anyone know the kinda programming Language script editor Uses
But I heard somewhere that it is C Language. :?: :roll:
User avatar
Ehman
 
Posts: 186
Joined: Wed Apr 18, 2018 7:56 pm
Location: MonsteRealm
Score: 1 Give a positive score

Re: Collision problem

Postby lcl » Tue May 01, 2018 9:05 am

Ehman wrote:Did anyone know the kinda programming Language script editor Uses
But I heard somewhere that it is C Language. :?: :roll:

Yes, Game Editor uses C.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Collision problem

Postby Ehman » Fri May 04, 2018 3:17 pm

THANKS LCL
User avatar
Ehman
 
Posts: 186
Joined: Wed Apr 18, 2018 7:56 pm
Location: MonsteRealm
Score: 1 Give a positive score


Return to Getting Started

Who is online

Users browsing this forum: No registered users and 1 guest