The Daily Click ::. Forums ::. Klik Coding Help ::. Always set position bug
 

Post Reply  Post Oekaki 
 

Posted By Message

Weston L



Registered
  16/12/2002
Points
  1603
22nd August, 2003 at 22:50:45 -

I have a character where he has his head as a seperate active object. But, when the feet stop, the head keeps going for a few pixels. It lags in certain ways. Is there a way to speed up the always condition?

- Me

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
23rd August, 2003 at 01:49:12 -

No, sorry, I did some reasarch on this. The Always thing as fast as MMF will go. 'Tis more of Every 0.02 seconds, just that it uses less memory and would perform faster than the Every 0.02 seconds condition.

You can try to use to use the fast loop option, though I'm not sure that'll work. Another classic way was to make an exact copy of the event so it would supposedly work twice as fast. Or easier still, put all your Always events at the top of the list in the Event editor. It'll make sure that that condition is viewed before anything else every time MMF does another loop.

But still, you must have pretty fast eyesight to notice the difference in it in just 0.02 seconds. Maybe you've just coded it a bit clunky.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
23rd August, 2003 at 02:46:38 -

Make another active that does all the movement, and set the head and body to that.

 
gone fishin'

Daniel[Crazy_Productions]

Possibly Insane

Registered
  29/12/2002
Points
  2505
23rd August, 2003 at 04:06:19 -

there is another way using maths... too bad i forgot how to do it

 
Beware of life ...so far noone have survived it.......

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
23rd August, 2003 at 05:41:19 -

Maths = Headache . hmm.. i also get that Weston, what Muz says sounds pretty good.

 
HES homepage:
http://www.distinctiv-efair.com/heretic/studios
Crystal Clear Productions: http://www.distinctiv-efair.com/heretic/crystalclear

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
23rd August, 2003 at 06:38:04 -

Another method is custom movement, for both object move the same amount:

right was pressed - player.x = player.x + 2, spoon.x = spoon.x + 2

Then they will move the same amount and there will be no lag.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
23rd August, 2003 at 10:31:07 -

LOL, Andy, unneccessary headache. Instead of using that -, try putting : instead. It makes a big difference when you're using a math formula.

It's still a good, flawless piece of code, though you'll then have to do a custom engine. For simplicity, go with Shen's idea or just try my idea and see if you can do it without really bothering to write new code.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image
   

Post Reply



 



Advertisement

Worth A Click