Jump to content


Photo

Collision and Sprite issues


  • Please log in to reply
3 replies to this topic

#1 Bakuryu

Bakuryu

    GMC Member

  • New Member
  • 14 posts

Posted 27 February 2012 - 09:32 PM

I'm sorry if my topic name isn't very descriptive. I'm using GM 8.1 non Pro, I haven't learned all of GM's syntax yet, but I understand basic programming logic (ifs/loops,arrays,etc)

I'm working on a fighting engine and I have already searched and see that there are some already made (with GM not 2DFM or MUGEN), but even if I used these engines the problems I am having would still happen.

Right now my character moves left,right, jumps and ducks. Problem is when he jumps and lands there is a split second as the falling sprite hits the ground where he changes to standing and slides down the rest of the way. I thought of moving the collision area, the problem is it effected the rest of the sprites in the image making it so that when I he lands he ends up landing slightly inside the floor making it impossible to move once it changes to the normal standing position. What weird is slowing it down I come to realize it doesn't at all look like the tip of his foot is hitting the floor and I know for a fact that there is no extra pixels under his foot. I think its just changing as soon as it hits on that frame though. Along with this is the problem that as soon as it makes contact I can jump again which throws off the animation I guess I could add a check for a variable that's made when the falling object collides with the floor to tell it it just landed. The next problem I am having is with ducking. Right now I want it to play the animation of the object then loop through the last 4 frames, the first frame is just a transition sprite. It's almost a duck idle animation. Should I just make a separate object for transition animations?

I was using the follow code to attempt this using this post as a reference: http://gmc.yoyogames...howtopic=500567

if (keyboard_check_pressed(vk_down))
{
      if (image_index = 8) || (image_index < 3)
      {
            image_index = 3
            image_speed = 1
      }
}

Edited by Bakuryu, 27 February 2012 - 09:33 PM.

  • 0

#2 thegame

thegame

    Flying Penguin

  • GMC Member
  • 1488 posts
  • Version:GM:Studio

Posted 27 February 2012 - 10:53 PM

The reason your character does not land perfectly is probably because you didn't use move_contact_solid(dir,maxdist);
Make dir 270 for down, and maxdist should be vspeed, so it would look like move_contact_solid(270,vspeed);
  • 0

#3 Bakuryu

Bakuryu

    GMC Member

  • New Member
  • 14 posts

Posted 27 February 2012 - 11:04 PM

The reason your character does not land perfectly is probably because you didn't use move_contact_solid(dir,maxdist);
Make dir 270 for down, and maxdist should be vspeed, so it would look like move_contact_solid(270,vspeed);

Just tried that it didn't work I'm gonna upload the file so people know what I am working with. Like I said these sprites are place holders, but I plan on making ones of similar size and shape.

http://www.mediafire...4g85n96vm5h5uh5
  • 0

#4 Bakuryu

Bakuryu

    GMC Member

  • New Member
  • 14 posts

Posted 28 February 2012 - 08:52 PM

Still having these issues, not sure what to do :\
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users