Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!

Join the forum, it's quick and easy

Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Log in

I forgot my password

Search
 
 

Display results as :
 


Rechercher Advanced Search

Site Hits
Free hit counter
These stats started at 0 on July 7th 2009
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: https://gameml.forumotion.com/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com

Worm/Snake code

+2
Sparx the Cy-Wolf
GoldenBeastStudios
6 posters

Go down

Worm/Snake code Empty Worm/Snake code

Post by GoldenBeastStudios Fri Jan 29, 2010 10:49 pm

I'm attempting to make a worm/snake kinda enemy, but I can't seem to get the body segments to follow the head in a logical way. I'm basically trying to use the xprevious and yprevious of the head, except it needs to be the 30th previous x and y, so that body segments follow the head, but not right next to it (thus reducing the number of objects needed). Here's a pic of what I'm trying to do:
Worm/Snake code Conga_line_3


Any pointers anyone?

John
GoldenBeastStudios
GoldenBeastStudios
GameML Adventurer
GameML Adventurer

Posts : 117
Points : 54414
GameML Reputation : 2
Join date : 2009-07-09
Age : 41
Location : Austin, Texas

http://www.goldenbeaststudios.com

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by Sparx the Cy-Wolf Sat Jan 30, 2010 2:09 pm

It's a long shot, but have you thought about usig alarms on each segment that differes for each one, for instance the second segment would differ in time from the first one by, let's say "10" beofre it does the same "action" when following the first, while the third one would differ by "20" from the first and....you get the idea?
Sparx the Cy-Wolf
Sparx the Cy-Wolf
Admin
Admin

Posts : 1775
Points : 56475
GameML Reputation : 5
Join date : 2009-06-07
Age : 33
Location : Mother ship

http://www.yoyogames.com/members/Sparx%20the%20Cy-wolf

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by The SNIC Sat Jan 30, 2010 3:00 pm

to difficult. Probably will not work. I say you just make several segments as different objects. make one segment move towards another segment like: for part3 move_towards_point(part2.x,part2.y,3) then make qa mask for all of them andif it collides with that object, stop following. theres an AI gm7 video for a AI partner. It has how to keep distance, use that following code(all of it) in your thing!
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 55040
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by Sparx the Cy-Wolf Sun Jan 31, 2010 6:03 am

yeah I guess that could work to.....
Sparx the Cy-Wolf
Sparx the Cy-Wolf
Admin
Admin

Posts : 1775
Points : 56475
GameML Reputation : 5
Join date : 2009-06-07
Age : 33
Location : Mother ship

http://www.yoyogames.com/members/Sparx%20the%20Cy-wolf

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by fooey Sun Jan 31, 2010 9:10 am

i did this once to give a trail to the mouse, that the trail was just a line.

it involves alarms and variables.
ok simple on alarm0 (which is 10 steps long): jump part1 to x1,y1 then jump part2 to x2,y2 ect... then set x3,y3 to x2,y2 then x2, y2 to x1,y1 then x1,y1 to whatever the main object is.
fooey
fooey
Moderator
Moderator

Posts : 1422
Points : 55740
GameML Reputation : 1
Join date : 2009-07-10
Age : 29
Location : here

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by The SNIC Sun Jan 31, 2010 3:15 pm

uh, I think he solved it, but let me check to make sure...
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 55040
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by 65loconut Sun Jan 31, 2010 6:31 pm

Woah! Looks tough! I could never do this! Tell me how to do it when your done!
65loconut
65loconut
GameML Noob
GameML Noob

Posts : 8
Points : 52205
GameML Reputation : 1
Join date : 2010-01-31

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by CarnivorousA Mon Feb 01, 2010 4:16 am

Usually I'm a man of action but this has got me fucked.
Using xprevious would pretty much make them right inside each other, but all of them moving towards the next one will probably not work that way...
CarnivorousA
CarnivorousA
Moderator
Moderator

Posts : 1402
Points : 56572
GameML Reputation : 17
Join date : 2009-06-01
Age : 29
Location : At the bottom of the lake.

http://entertainmypeople.freeforums.org/index.php

Back to top Go down

Worm/Snake code Empty Re: Worm/Snake code

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum