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: Probs with hook shot  (Read 1872 times)

0 Members and 1 Guest are viewing this topic.

Zhello

N.A.D.I.
Probs with hook shot
« on: September 06, 2009, 05:39:30 pm »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
I don't have pro so it makes it even harder.  I try to put the code with only direction, it works but the prob i got was when the player uses the obj hook shot, the obj hook it goes the opposite way, it works like it should but it that problem only.


Im guessing the prob is in either the draw event or create.

the input it this code is only base on direction cuz i cant use image angle due to not having pro. :)
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: Probs with hook shot
« Reply #1 on: September 06, 2009, 07:45:33 pm »
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1638
Not to sound harsh but you won't get much help with that explanation. What is the current situation? What is the problem? And what is the question / what would you like from us?

Showing some code will also clarify thing a lot better, since people will have trouble reading those sentences of yours. Not that my english is perfect, but it's hard to get what you are saying. Have you tried putting your text into an translation site? That might work.
Logged
Re: Probs with hook shot
« Reply #2 on: September 06, 2009, 09:59:10 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
hookshot.direction += 180
Logged



i love big weenies and i cannot lie

Zhello

N.A.D.I.
Re: Probs with hook shot
« Reply #3 on: September 08, 2009, 01:46:49 am »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
obj.hookshot creation code
Quote
pulling=0
switch (global.facing){
  case 'D':  direction=270;y+=10;speed=5; break;
  case 'U':  direction=90;y-=10;speed=5; break;
  case 'R':  direction=0;x+=10;speed=5; break;
  case 'L':  direction=180;x-=10;speed=5; break;
}
direction=direction+180
depth=-y
alarm[0]=30

now the obj.hookhandle
Quote
switch (global.facing){
  case 'D':  direction=180;y+=10; break;
  case 'U':  direction=0;y-=10; break;
  case 'R':  direction=270;x+=10;y+=4; break;
  case 'L':  direction=90;x-=10;y+=4; break;
}
depth=-y
instance_create(x,y,objHookshot)
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/

Mamoruanime

@Mamoruanime
Re: Probs with hook shot
« Reply #4 on: September 08, 2009, 05:09:27 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
"direction=direction+180" looks like the issue o.o... but I could be wrong. Either way; it's always firing behind link, so that would make sense. This direction (>) + 180 would be (<).
Logged
Re: Probs with hook shot
« Reply #5 on: September 08, 2009, 06:46:54 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3374
yeah, try:
directon += 180;

first though, check if that's possible, so:
Code: [Select]
if (direction < 180)
{
direction += 180;
}
else
{
direction -= 180;
}
that keeps it from going over 360, and should reset it to 0 if it is exactly 180.
« Last Edit: September 08, 2009, 06:49:56 am by Darklight »
Logged
Quote from: Jason
Your community is a bunch of stuck up turds.
Re: Probs with hook shot
« Reply #6 on: September 08, 2009, 05:30:16 pm »
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1638
I'm also guessing the problem is in this line: direction = direction + 180.
You first set the correct direction. Then you add 180 degrees making it the opposite direction. Thus you fire backwards. Lose this one line and it's fixed again.
Logged
Re: Probs with hook shot
« Reply #7 on: September 08, 2009, 08:19:07 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
yeah, try:
directon += 180;

first though, check if that's possible, so:
Code: [Select]
if (direction < 180)
{
direction += 180;
}
else
{
direction -= 180;
}
that keeps it from going over 360, and should reset it to 0 if it is exactly 180.

Said this 3 posts ago >_>
Logged



i love big weenies and i cannot lie
Re: Probs with hook shot
« Reply #8 on: September 08, 2009, 10:46:56 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3374
yeah, try:
directon += 180;

first though, check if that's possible, so:
Code: [Select]
if (direction < 180)
{
direction += 180;
}
else
{
direction -= 180;
}
that keeps it from going over 360, and should reset it to 0 if it is exactly 180.

Said this 3 posts ago >_>
wasn't reading as usual.
Logged
Quote from: Jason
Your community is a bunch of stuck up turds.

Zhello

N.A.D.I.
Re: Probs with hook shot
« Reply #9 on: September 12, 2009, 08:49:41 pm »
  • L'homme avec beaucoup de noms.
  • *
  • Reputation: +6/-1
  • Offline Offline
  • Gender: Male
  • Posts: 925
Ill give it a try. :)
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/
Pages: [1]   Go Up

 


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



Page created in 0.759 seconds with 57 queries.