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: Problem with picking up items  (Read 1034 times)

0 Members and 1 Guest are viewing this topic.

Zhello

N.A.D.I.
Problem with picking up items
« on: March 19, 2009, 02:02:28 am »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
i have some problems while working on my game.

1.  when link picks up an item,  it is normal but under him, there another link sprite.

2.  While holding an item, link is still able to slash, how can i prevent that? :huh: :huh: :huh:
Logged
The IT Guy
Intermediate Coder
Linux is a wonderful thing
~Linkwolf48/Gumstone1080~

The Legend of Zelda - New Beginnings

http://zfgc.com/forum/index.php?topic=34986.0
1.6 Demo -
https://www.dropbox.com/s/56km0iadaras56g/LoZNB%20Game%20Folder.rar?dl=0


Side Projects:

Dragon Diary - Cybernetic Threat
Story: http://wiki.zfgc.com/Cybernetic_Threat

Quote
Aero88
ZFGC is like the Hotel California.  You can come in but you can never leave!

devianart: http://linkwolf48.deviantart.com/
Re: Problem with picking up items
« Reply #1 on: March 19, 2009, 02:12:30 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
The wording of your first question is odd, but the answer to both of them could be the use of states. This involves having a generic local or global variable called "state" which keeps track of whether you are "normal" (walking around or stopped), "sword" (slashing/walking/or spinning with sword), "holding" (holding something above yourself), etc.

Assuming that in the first problem you had was that when you walked around you had Link's walking sprite animation with his holding sprite animation, the use of states would make it so the correct animation would work. For the second problem, having it set up so you could only slash when you are in the "normal" state would solve your issue.

And really though, if there is an issue with doing something in any programming language, just think about it logically - the program only does exactly what you made it to do.
Logged
Re: Problem with picking up items
« Reply #2 on: March 19, 2009, 07:21:40 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
What language are you using and can we see your code?
Logged



i love big weenies and i cannot lie
Re: Problem with picking up items
« Reply #3 on: March 19, 2009, 10:43:02 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1141
1. That's very strange, I'll need to see the code.

2.Just do:
//in the code for getting item:
status = HOLDING_ITEM

//in the code for pressing the button/key to slash:
if(status!=HOLDING_ITEM)
{
    //slash
}

//or this:

if(status!=HOLDING_ITEM)
{
    //slash
}
else
{
    //do something else (ex.: throw item and set back status=NORMAL)
}
Logged
Pages: [1]   Go Up

 


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



Page created in 0.091 seconds with 42 queries.

anything