Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Picking Up Items  (Read 1182 times)

0 Members and 1 Guest are viewing this topic.
Picking Up Items
« on: January 26, 2007, 05:52:27 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 413
Just out of curiosity, what would be the best way to create a Zelda-style picking up/throwing engine? I've considered using paths, a move-to-point style system, even time lines, but what do you guys think would be the best method to make this?
Logged
Re: Picking Up Items
« Reply #1 on: January 26, 2007, 06:24:41 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
It would probably be a decent idea to set a vertical speed & have it slowly come to a halt as it's thrown, and when it's vspeed is 0 or less, have it do its crashing thing
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

mit

Re: Picking Up Items
« Reply #2 on: January 26, 2007, 06:45:30 pm »
  • QBASIC programmer since age 4. Take that, world.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 1079
I made an example a while back out of Goodnight's movement engine (the first version): http://www.kousougames.co.uk/data/downloads/counter.php?file=PickupObjectsEngine

Can't remember how it works and can't be bothered to download again. But it doesn't use paths or timelines, I think it's just an alarm for the throwing. Setting the height and width to whatever times the current value of the alarm. It's a lazy way of coding, but actually more efficient, as it use less resources.

Logged
Programmer / Spriter / Level designer / Game Director / Web Designer / Music Sequencer for
Random Highscore table:

Play the Kousou Arcade today!
  • Kousou Games

Goodnight

Once and future Captain
Re: Picking Up Items
« Reply #3 on: January 26, 2007, 07:28:16 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
My method (in super-brief):

1. Get the id the object you want to pick up, preferably using collision_line() to detect a short distance directly in front of Link.
2. Compare the x and y of Link to this object, to make sure they're close and fairly in line.
3. Create a dummy object at Link's position and pass on the sprite, important variables, time left until explosion (for bombs), and id from the liftable object.
4. Dummy object follows Link at (objLink.x,objLink.y) as long as it's being held, and draws its sprite at (x+offset,y-height).
5. Deactivate the liftable object and set Link's lifting animation. For each frame of this animation, change the dummy object's offset and height so it appears to be lifted.
6. Also, have the dummy object's height change slightly based on Link's walking frame so it appears to bounce along with him.
7. When you throw it, set the dummy object to no longer be held (so it doesn't follow Link) and set its speed and direction. Use a time line to alter its height variable so it appears to arc and bounce.
8. If the dummy object has a rock/pot/bush sprite, you can have the time line destroy it the first time its height hits 0, otherwise if it's a bomb, it can keep bouncing a few times and then stop moving at the end of the time line.
9. At the end of the time line (when the bomb has stopped moving), have it reactivate the original liftable object (that's why you recorded its id), move the original object to the dummy object's current position. In the dummy object's Destroy event (for rocks/pots/bushes that destroy without bouncing), also have these actions, and make the original object destroy itself as well.
10. Debris / explosions / random items are spawned from the original object's Destroy event.

There, I didn't say it was easy, but it totally works.

Scooternew and King Mob have also done good lift/throw features if I'm not mistaken, their methods are probably different.
Logged

Antidote

>.>
Re: Picking Up Items
« Reply #4 on: January 26, 2007, 11:01:21 pm »
  • In all seriousness who's serious?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1485
wow that was brief O_O. nice method Goodnight i'll try and make an example of that and post it if you don't want to.
Logged
  • Axiomatic Data Laboratories

Goodnight

Once and future Captain
Re: Picking Up Items
« Reply #5 on: January 27, 2007, 08:29:05 am »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
wow that was brief O_O. nice method Goodnight i'll try and make an example of that and post it if you don't want to.

Heheh.. it was going to be brief, then I remembered all these snags we might get stuck on if I leave out little details. :P Sure, please give it a try, I won't have time for a few days.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.182 seconds with 46 queries.

anything