How to make a spider-like actor.

Learn how to start making games.

How to make a spider-like actor.

Postby Kcee » Thu Jul 20, 2017 1:57 pm

How do I make an actor that can swing with webs and stick to walls.
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: How to make a spider-like actor.

Postby ITomi » Wed Aug 02, 2017 12:10 pm

I think, you have to check the collision, whether what is the other actor in the same position with the spider actor. If you want check the collisions yourself in GE scripts, I recommend you this useful code to 2d collison detection:
if (rect1.x < rect2.x + rect2.width &&
rect1.x + rect1.width > rect2.x &&
rect1.y < rect2.y + rect2.height &&
rect1.height + rect1.y > rect2.y) {
// collision detected!
}
from here: https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection
You have to replace rect1 and rect2 with the names of your actors in your game.
User avatar
ITomi
 
Posts: 48
Joined: Sun Aug 21, 2016 1:56 pm
Location: Hungary
Score: 5 Give a positive score

Re: How to make a spider-like actor.

Postby Kcee » Mon Aug 07, 2017 2:44 pm

Thanks for replying but I'm having a tough time trying to understand the code. :(
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: How to make a spider-like actor.

Postby ITomi » Wed Aug 09, 2017 1:04 pm

The 2d collision detection code? It is not requires the understanding, just replace rect1 and rect2 with the names of your actors in your game.
For example spider instead of rect1s and wall instead of rect2s. The x, y, width and height are build in variables in GE too, so you can use these. These variables represents the dimensions of sprites of your game actors.
User avatar
ITomi
 
Posts: 48
Joined: Sun Aug 21, 2016 1:56 pm
Location: Hungary
Score: 5 Give a positive score

Re: How to make a spider-like actor.

Postby Kcee » Wed Aug 09, 2017 1:43 pm

ITomi wrote:The 2d collision detection code? It is not requires the understanding, just replace rect1 and rect2 with the names of your actors in your game.
For example spider instead of rect1s and wall instead of rect2s. The x, y, width and height are build in variables in GE too, so you can use these. These variables represents the dimensions of sprites of your game actors.
I want to understand the code so that i can be a better programmer, thanks any way.
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: How to make a spider-like actor.

Postby Kcee » Wed Aug 09, 2017 2:00 pm

Also, why don't you join us in the ''other'' forum ( under the topics: count to 1000 and last to post wins ).
User avatar
Kcee
 
Posts: 265
Joined: Tue Feb 14, 2017 5:40 pm
Location: Dimension GE
Score: 13 Give a positive score


Return to Getting Started

Who is online

Users browsing this forum: No registered users and 1 guest