ID:155322
 
mob/verb/Jump() 
flick("Jump",src)
pixel_y+= 10
sleep(1)
pixel_y+= 10
sleep(1) //when reached its peak it goes free fall
pixel_y+= 10
sleep(1)
pixel_y-= 10
sleep(1)
pixel_y-= 10
sleep(1)
pixel_y-= 10



Is there a way to make it smoother like Forum_account's pixel movement.

ALSO, how do I set it so let's say.. if you press spacebar you'll jump. I looked at Forum accounts way but it was confusing to me.
Look up interface macros.

Also, your Jump verb will only move your mob's icon up 10 pixels, not the actual mob itself.
In response to Neimo
Neimo wrote:
Look up interface macros.

Also, your Jump verb will only move your mob's icon up 10 pixels, not the actual mob itself.

So let's say I want to jump from building to building, how would I go about doing that?
In response to Chaorace
You can look into various libraries on how pixel movement works.
In response to Neimo
OK I changed the code up a little.

mob/verb/Jump() 
flick("Jump",src)
pixel_y+= 3
sleep(1)
pixel_y+= 5
sleep(1)
pixel_y+= 7
sleep(1)
pixel_y-= 3
sleep(1)
pixel_y-= 5
sleep(1)
pixel_y-= 7



I tested it and it moves up twelve pixels and back down twelve pixels.

Now. If we make the pixel_-=y under twelve, lets say 6, it'll move the mob up 6 pixels and if you keep clicking it your mobs moves up the map. So it moves the mob.

Now I have to make it so you can jump certain hieghts like maybe I want to jump on a boulder so I hop up there. BUt maybe I try to jump on a building but the building is too big to get ontop of, so you can't jump up there or onto the building, so you land back where you started. Is that possible. And I would use forum_accounts guide but it's all confusing to me since I'm just a novice programmer
In response to Chaorace
Go and search for pixel movement by Forum_account. It has jump and all inside his library.

~Midget
In response to Midgetbuster
I did but I don't understand it very well since I'm a novice programmers, which I said in my last post xD
In response to Chaorace
There are some comments in it which explain what's going on pretty well. It even has sections for new coders and intermediate coders. And even if it didn't have comments, how do you expect to learn to code if you can't read it?
In response to Lugia319
Yeah you're right. I'll study a little more. Thanks you guys for your time.
In response to Chaorace
I don't know why you modified your code, it still doesn't change the fact of what I said from my first post.
In response to Neimo
Neimo wrote:
Your verb will only move your icon, not the mob itself.



What do you mean by that, It confuses me. So you mean like.. it doesn't move the clients view?
In response to Chaorace
It moves your image up however many pixels you want it and the actual client doesn't move at all.
In response to Neimo
Yeah you're right I tested it, I can't figure out how to make the client move with it, so I'm trying to put a delay on mass clicking it so you can only jump once and has a 3 second cooldown.. So something like


mob/verb/Jump() 
flick("Jump",src)
usr.Jump = 1
pixel_y+= 15
sleep(1)
pixel_y+= 20
sleep(1)
pixel_y+= 10
sleep(1)
pixel_y-= 15
sleep(1)
pixel_y-= 20
sleep(1)
pixel_y-= 10
if(usr.Jump==1)
sleep(30)
else
usr.Jump = 0



But it doesn't work so I know I'm doing something wrong.
In response to Chaorace
Sorry to go off topic, but being a fellow novice programmer, I suggest trying Forum Account's http://www.byond.com/developer/Forum_account/EnemyAI Tutorial. I call it a tutorial because it's very well commented and it shows you how to do some awesome stuff step by step. You take the lessons one at a time and each lesson/example is better than the first. I think anyone would be sure to love it.
In response to Truseeker
Thansk for the advice.