The Daily Click ::. Forums ::. Klik Coding Help ::. 8direction costum movement diagonally move.
 

Post Reply  Post Oekaki 
 

Posted By Message

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
12th September, 2007 at 15:19:03 -

yo there.
a quick, big question.
so
User presses any direction, active object move 1pixel / frame. So it's speed is 1pixel/frame.
Now. When user presses for example UP and LEFT, it moves 1pixel up and 1pixel left. And now it's speed is sqr(2)/frame.

I tried to, use thing like Alt.Values, so, set x position to (Alt.Value A / 100) and similar to pos_y.
And i used to add 100 when user pressed just UP, DOWN, LEFT, RIGHT, and add 70 to x and y when user presses that active object move diagonally. This is not very good because when the playermoves diagonally, the object is a bit "jumping" because X/100 and Y/100 do NOT change at the same time. So simetimes it moves only (for example while pressing UP and LEFT) left and than it moves up and left too, but in the next minute it moves only up. soo. it is not fine.

Any suggestions for a nice guy like me? :C

Image Edited by the Author.

 
:C

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
12th September, 2007 at 15:21:59 -

yo. i hope u won't misunderstand my topic's title.. sorry for misstype :C
and sqr(2)/frame is sqrt(2)/frame of course.

Image Edited by the Author.

 
:C

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
13th September, 2007 at 15:00:37 -

anyone anything? ;>

 
:C

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
13th September, 2007 at 16:29:45 -

Okay, the object will move only left OR up when holding both keys down? I'm crappy at custom movements but if you make this event it may work:

User presses UP and LEFT
-Set player's x pos-1
-Set player's y pos-1


Dunno if it will work as I have not tried it myself... Maybe it will?

Image Edited by the Author.

 
Image

Tell 'em Babs is 'ere...

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
17th September, 2007 at 14:23:40 -

it simply does not working for me :/
did i do something wrong?

 
:C

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
17th September, 2007 at 17:25:24 -

more likely then not, you're having 3 triggers at the same time; the one for LEFT, the one for TOP, and the one for LEFT AND TOP.


You need to make sure you've got a "upon holding LEFT + (negate) upon holding TOP + (negate) upon holding BOT" and such for every direction

You need to make sure they trigger when one direction and ONLY that one direction is held down. If not, the unit will be moving 1.71 in both directions, instead of .71

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
18th September, 2007 at 08:21:05 -

yes yes, ive done that before but imho it doest like the broken nubers, does it?
i do like this way:
diagonal:

-Repeat while "Left arrow" is pressed
+Repeat while "Down arrow" is pressed
+(negate)Repeat while "Up arrow" is pressed
---Add 0.7071 to value A
---Add 0.7071 to value B

Straigh movement:

-Repeat while "Left arrow" is pressed
+(negate)Repeat while "Down arrow" is pressed
+(negate)Repeat while "Up arrow" is pressed
---Add 1 to value A


hm
guys can u send me a little "sketch" about your imagination in cca? of mfa? or something like this.

 
:C

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
19th September, 2007 at 08:17:47 -

thankyou.
it is the same as mine. Try it with scrolling ang with some detailed backgorund. You'll see what i meant.
Now, if noone have any further ideas then ill have to use that version when diagonalmovement is faser.


 
:C

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
19th September, 2007 at 10:17:16 -

but it DOES bother me :C

 
:C
   

Post Reply



 



Advertisement

Worth A Click