| |
Problem with Yoshi's tongue, (close to fixing it!)
yoshi-warrior |
|

Standard Member

Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
Alright, to save myself time on typing the question out, I'll provide the link to the topic on the game maker community forums where I have the explanation of the problem. problem with Yoshi's tongue TopicI figured I'd post my problem here since this is a more Mario-based community and might have someone who can help me out. Basically, the tongue object moves using hspeed and I need the tongue to follow Yoshi without interfering with the object's hspeed. If I set the tongue object to follow "yoshi.x" then it stops the tongue object's hspeed. You can read more about it in the link. The link also provides a download of the gmk file containing the problem. Also, you can post your replies/questions here instead of on the GM forum. Any and all help is greatly appreciated! If this problem can get fixed, I'll put your name in the credits of my future fan-game.  Edit: Okay, I think I might have made a break through! In the step event for the yoshi object, I have a script that I used for his movement controls. The original script looked like this(this is for the right key event): | CODE | if place_free(x+3,y-3) and !place_free(x+3,y){x+=3 y-=3}
|
Right now, I just changed it to this:
| CODE | if place_free(x+3,y-3) and !place_free(x+3,y){x+=3 y-=3}{tongue_object.x+=3 tongue_object.y-=3}
|
Basically, I added a code to move the tongue when the Yoshi object goes up a slope.
Now there's only one thing that needs to be fixed: When Yoshi is walking up against a wall and he shoots his tongue out, the tongue detaches from his mouth. I just gotta figure out how to make the tongue stay if there's something in front of it.
This post has been edited by yoshi-warrior on Jul 4 2008, 09:53 PM
|
|
|
zzo38 |
|
Registered user

Group: Members
Posts: 1621
Member No.: 2549
Joined: 21-August 06
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
| QUOTE (yoshi-warrior @ Jun 30 2008, 04:30 PM) | Everything involving the tongue's movement is in the end step event. But wouldn't making the tongue's depth smaller than Yoshi's depth make the tongue appear on top of yoshi? yoshi's depth=-5 tongue's depth=0 Making the depth a smaller number would put that object on top. |
Yes it would, but ALL events (including draw event) happen in order of depth.
You should put the tongue movement codes in the yoshi object end step event: | CODE | | if(instance_exists(Tongue)) with(Tongue) { x=Yoshi.x;y=Yoshi.y } |
--------------------
|
|
|
Ziso |
|

Should I be concerned?
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif)

Group: Members
Posts: 992
Member No.: 3387
Joined: 2-March 07
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
Is Yoshi's tongue always in existence? Or do you create it when it's time for Yoshi to lick?
This might in part have to do with your sprites.
In your end step for the tongue, I would put.
| CODE | if yoshi.(variable that means he's in licking mode) = 1 { // here, I would list if yoshi.image_index = # (do this for all the sub images of his licking sprite) {x = yoshi.x+(where ever the tongue should be depending on the subimage} |
Now that may be a bit confusing, but what I mean is that when Yoshi licks, his head moves in the animation, so you want the tongue to stay in the same spot his head is. You assign the tongue a yoshi.x+# based on where Yoshi's head is in the animation. Where it is in the animation depends on the sub images (image_index). You will have to figure out what x goes with each sub images yourself since I don't know what sprites you're using.
Say the first sub image, the tongue should be at x+14, next one at x+15, next at x+17, etc. the code would look like this.
| CODE | if yoshi.islicking = 1{ if yoshi.image_index = 0 {x = yoshi.x+14} if yoshi.image_index = 1 {x = yoshi.x+15} if yoshi.image_index = 2 {x = yoshi.x+17}} |
If you don't understand what I'm getting at (I can be confusing when explaining my GM reasoning) just ask.
EDIT: about the first question. The tongue should not always be in existence. A good way to do this is to create the tongue at yoshi.x when he starts to lick. The end step code that I listed before will take care of where the tongue is in relation to the animation.
And you'll want to use that sub image logic for the tongue too when it licks an enemy. Move the enemy based on the sub image of the tongue (because it grows and shrinks in the animation).
This post has been edited by Ziso on Jul 2 2008, 12:45 PM
--------------------
|
|
|
yoshi-warrior |
|

Standard Member

Group: Members
Posts: 19
Member No.: 5281
Joined: 11-May 08
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
| QUOTE (Ziso @ Jul 2 2008, 12:42 PM) | Is Yoshi's tongue always in existence? Or do you create it when it's time for Yoshi to lick?
This might in part have to do with your sprites.
In your end step for the tongue, I would put.
| CODE | if yoshi.(variable that means he's in licking mode) = 1 { // here, I would list if yoshi.image_index = # (do this for all the sub images of his licking sprite) {x = yoshi.x+(where ever the tongue should be depending on the subimage} |
Now that may be a bit confusing, but what I mean is that when Yoshi licks, his head moves in the animation, so you want the tongue to stay in the same spot his head is. You assign the tongue a yoshi.x+# based on where Yoshi's head is in the animation. Where it is in the animation depends on the sub images (image_index). You will have to figure out what x goes with each sub images yourself since I don't know what sprites you're using.
Say the first sub image, the tongue should be at x+14, next one at x+15, next at x+17, etc. the code would look like this.
| CODE | if yoshi.islicking = 1{ if yoshi.image_index = 0 {x = yoshi.x+14} if yoshi.image_index = 1 {x = yoshi.x+15} if yoshi.image_index = 2 {x = yoshi.x+17}} |
If you don't understand what I'm getting at (I can be confusing when explaining my GM reasoning) just ask.
EDIT: about the first question. The tongue should not always be in existence. A good way to do this is to create the tongue at yoshi.x when he starts to lick. The end step code that I listed before will take care of where the tongue is in relation to the animation.
And you'll want to use that sub image logic for the tongue too when it licks an enemy. Move the enemy based on the sub image of the tongue (because it grows and shrinks in the animation).
|
I get exactly what you're saying. That's actually the first idea that I had with trying to program yoshi's tongue. But I found that process to be a little too tedious to program for the enemies.
With this idea I'm trying to fix, all I would have to do with the enemies is make it follow the tongue and since the anchor point would be the tip of the tongue, I wouldn't have to worry about the positioning.
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
[ Script Execution time: 0.1071 ] [ 14 queries used ] [ GZIP Enabled ] [ Server Load: 1.95 ]
| |