The Daily Click ::. Forums ::. Klik Coding Help ::. Anyway to save positions?
 

Post Reply  Post Oekaki 
 

Posted By Message

Battenburg



Registered
  24/04/2009
Points
  13
24th April, 2009 at 00:36:19 -

Pardon the lack of introduction but I'll scout around for the intro area in good time sirs. But I am in need of help and stumbled upon this site of MMF wizardry. I got plenty of questions for you all but I'd better start with this one first.

Is there anyway to store object posistions? After learning much about fast loops ,instances and spread values I took a step back and thought it wise to make a simple "snakes" game, generally found on mobile phones these days. So after creating jerky gridbased movements and random pill spawning I couldn't for the life of me figure out a meathod to create the snakes body parts.

It seemed to me if I could save the last position of the "Head" would be a logical idea, then by pill count and loops could somehow then just create new objects and detroy then on loops and such. Is this the simplest meathod? Is it even possible save positions? By any chance has anyone made snakes?

Anywho glad to meet you all, any help would be greatly appreciated.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
24th April, 2009 at 01:24:46 -

I would just create body parts with a limited life using one of the body parts' own alterable values.
You can store values in the snake's head too.

Snake's head
------------
value a is for snake speed.
value b is for how many tails the snake has.

body part
---------
value a is for body part's life

So the idea would be to add 1 to the snake's head value b when it eats a bug or whatever your game has. Then you can set the body part's a value based on whatever the snake's head values currently are when it is created.
And subtract from the body part's a value until it is 0 then destroy it.

 
.

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
24th April, 2009 at 01:51:28 -

The welcoming area is your first thread. Welcome to the site!

 

  		
  		

Battenburg



Registered
  24/04/2009
Points
  13
24th April, 2009 at 03:06:28 -


Originally Posted by AndyUK
I would just create body parts with a limited life using one of the body parts' own alterable values.
You can store values in the snake's head too.

Snake's head
------------
value a is for snake speed.
value b is for how many tails the snake has.

body part
---------
value a is for body part's life

So the idea would be to add 1 to the snake's head value b when it eats a bug or whatever your game has. Then you can set the body part's a value based on whatever the snake's head values currently are when it is created.
And subtract from the body part's a value until it is 0 then destroy it.



I think I get what your getting at. But how would I get these body parts to follow the head?

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
24th April, 2009 at 04:10:35 -

They don't need to follow it. They can just be created at wherever the head happens to be. So long as you constantly create more body parts they will all stay connected.
Say... every time the head moves?

 
.

Battenburg



Registered
  24/04/2009
Points
  13
24th April, 2009 at 04:55:53 -



YOU ARE A MASTERMIND MY GOOD SIR!

I'm gonna try it out now, thanks again!

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
24th April, 2009 at 05:19:15 -

heh no problem
 

			
  	    

 
.
   

Post Reply



 



Advertisement

Worth A Click