Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> My I need help thread(for me), Right now: Winged ? blocks.
Unspecified
mario4ever
Posted: Aug 30 2008, 11:58 AM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


Another help thread made by me? I know.

I have a new problem. I'm trying to create a winged ? Block like in super mario world, But the solid won't follow it right, plus I'm trying to make the verticial speed to make it go up and down smoothly without using invisible arrows. I know alarms will be used for this probally.

This post has been edited by mario4ever on Sep 5 2008, 07:39 PM


--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
Austria
Guinea
Posted: Aug 30 2008, 12:09 PM
Quote Post


6
[A][*][*][*][*]
[*][*][*][*][*]
[*]

Group Icon
Group: Admins
Posts: 8600
Member No.: 893
Joined: 15-March 05

Status: (0d) [--]


Are you sure that the problem is the checking of the collision, or could it be that you just put a bad code that is supposed to highlight the star?
PMEmail PosterAOLMSN
Top
Unspecified
mario4ever
Posted: Aug 30 2008, 12:12 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


I've tried:

if mouse_y = y
and stuff like that.

What do you mean by "highlight the star?" I've never heard that before.


--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
Austria
Guinea
Posted: Aug 30 2008, 12:18 PM
Quote Post


6
[A][*][*][*][*]
[*][*][*][*][*]
[*]

Group Icon
Group: Admins
Posts: 8600
Member No.: 893
Joined: 15-March 05

Status: (0d) [--]


QUOTE (mario4ever @ Aug 30 2008, 06:12 PM)
I've tried:

if mouse_y = y
and stuff like that.

What do you mean by "highlight the star?" I've never heard that before.

wellllll you want the mission name displayed when you go over the star. That's what I mean by it.

And also: "if mouse_y = y" is not a very helpful code, as it requires you to move your mouse on exactly ONE pixel on the screen.
PMEmail PosterAOLMSN
Top
Unspecified
mario4ever
Posted: Aug 30 2008, 12:30 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


QUOTE
And also: "if mouse_y = y" is not a very helpful code, as it requires you to move your mouse on exactly ONE pixel on the screen.


Ohh.. I get it, but then I have no idea what is the right code part.

Highlight the star, oh, I thought that you were talking about something about the code, my bad.


--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
United Kingdom
Pikax
Posted: Aug 30 2008, 12:59 PM
Quote Post


ERROR! One or more logical fallacies detected!
[*][*][*]

Group Icon
Group: Members
Posts: 913
Member No.: 4352
Joined: 1-September 07

Status: (0d) [--]


You really want to put the entire code (barring the if mouse_y = y) in a Mouse Enter event.


--------------------
CODE
<MrGuy> Damn, what happened to #mfgg being all about people talking about ****s
<MrGuy> And Raie video games
<ONova> That's later
<Serban> fffffffffffffffff
<Doodle> That's because Mikau isn't here.
*** Mikau has joined #mfgg


mariobro27 Pikax and love are not compatible, OK?
PMEmail Poster
Top
Unspecified
mario4ever
Posted: Aug 30 2008, 01:10 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


Ahh, I tried a "draw" event. I'll try that.

EDIT: It still won't work though. I put draw_text in the mouse enter event. I'm trying to restrain myself from using the game maker standard message.

This post has been edited by mario4ever on Aug 30 2008, 01:14 PM


--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
United Kingdom
Pikax
Posted: Aug 30 2008, 01:14 PM
Quote Post


ERROR! One or more logical fallacies detected!
[*][*][*]

Group Icon
Group: Members
Posts: 913
Member No.: 4352
Joined: 1-September 07

Status: (0d) [--]


Aw, poo, I didn't account for that.
Is the origin of the star in the center or in one of the corners, because I have some code that will help. It will mean that the text appears when the mouse is a little way off the star as well, but it's the best I can do.
Assuming the star's origin is in the center, do this:

CODE
if (mouse_x>=star.x-(star.sprite_width/2) and mouse_x>=star.x-(star.sprite_width/2) and mouse_x<=star.x+(star.sprite_width/2) and mouse_y>=star.y-(star.sprite_height/2) and mouse_y<=star.y+(star.sprite_height/2)) {
do stuff
}

Also, stick it in the draw event.

This post has been edited by mariobro27 on Aug 30 2008, 01:19 PM


--------------------
CODE
<MrGuy> Damn, what happened to #mfgg being all about people talking about ****s
<MrGuy> And Raie video games
<ONova> That's later
<Serban> fffffffffffffffff
<Doodle> That's because Mikau isn't here.
*** Mikau has joined #mfgg


mariobro27 Pikax and love are not compatible, OK?
PMEmail Poster
Top
Unspecified
mario4ever
Posted: Aug 30 2008, 02:03 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


Dang, still doesn't work. Wow this is hard. I tried what you said mariobro,
but I put the draw_text after that, but that looks right. I just need some way to get the text to show. I'm not very good at code, but I know that it is needed to do this sort of thing.


--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
Austria
Guinea
Posted: Aug 30 2008, 02:05 PM
Quote Post


6
[A][*][*][*][*]
[*][*][*][*][*]
[*]

Group Icon
Group: Admins
Posts: 8600
Member No.: 893
Joined: 15-March 05

Status: (0d) [--]


QUOTE (mario4ever @ Aug 30 2008, 08:03 PM)
Dang, still doesn't work. Wow this is hard. I tried what you said mariobro,
but I put the draw_text after that, but that looks right. I just need some way to get the text to show. I'm not very good at code, but I know that it is needed to do this sort of thing.

if (mouse_x>=star.x-(star.sprite_width/2) and mouse_x>=star.x-(star.sprite_width/2) and mouse_x<=star.x+(star.sprite_width/2) and mouse_y>=star.y-(star.sprite_height/2) and mouse_y<=star.y+(star.sprite_height/2)) {
do stuff
}
draw_text(sfsdfdsfds);

like this??

Because actually, you need to replace the "do stuff" part with whatever you want to do.
PMEmail PosterAOLMSN
Top
Unspecified
mario4ever
Posted: Aug 30 2008, 06:56 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


This still doesn't work, I don't know that's wrong, the draw_text says it has wrong number of arguments to function, I don't know what you mean by do stuff, I need nothing inbetween it, and this is really getting me mad.


--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
Canada
OmegaDestroyer
Posted: Aug 30 2008, 07:05 PM
Quote Post


Regular


Group Icon
Group: Members
Posts: 108
Member No.: 3755
Joined: 11-May 07

Status: (0d) [--]


How about this idea?

Determine the middle of the star's sprite (you've likely declared the middle of the star sprite to be the origin, so the middle of the sprite when drawn is its own current XY coordinate). Then consider a radius around the star.

Then use this code for each star object:
CODE
if (point_distance(x,y,mouse_x,mouse_y) <= star_radius
{   // code for on }
else
{   // code for off }


--------------------
My website: Logeot.com
My Current Project: ???
user posted image
PMEmail PosterUsers WebsiteYahooMSN
Top
United States
Noone
Posted: Aug 30 2008, 07:46 PM
Quote Post


You win the prize!!!
[*][*][*]

Group Icon
Group: Members
Posts: 511
Member No.: 3101
Joined: 23-December 06

Status: (0d) [--]


I can't believe how much people don't get how to do this...

Draw Event:
CODE

draw_sprite(sprite_index,image_index,x,y)
if position_meeting(mouse_x,mouse_y,self)
{
draw_text(x,y,"String")
}


Also, make sure if it has a mask, the mouse can collide with it. Like no empty transparent sprites for the mask.


--------------------
user posted image
PMEmail PosterUsers WebsiteICQAOLYahooMSN
Top
United Kingdom
Pikax
Posted: Aug 31 2008, 04:26 AM
Quote Post


ERROR! One or more logical fallacies detected!
[*][*][*]

Group Icon
Group: Members
Posts: 913
Member No.: 4352
Joined: 1-September 07

Status: (0d) [--]


QUOTE (mario4ever @ Aug 30 2008, 06:56 PM)
This still doesn't work, I don't know that's wrong, the draw_text says it has wrong number of arguments to function, I don't know what you mean by do stuff, I need nothing inbetween it, and this is really getting me mad.

This is how if statements work.
If (conditon) {do stuff}

You need the draw_text in the { }
If you still don't understand this, maybe coding isn't for you.

This post has been edited by mariobro27 on Aug 31 2008, 04:26 AM


--------------------
CODE
<MrGuy> Damn, what happened to #mfgg being all about people talking about ****s
<MrGuy> And Raie video games
<ONova> That's later
<Serban> fffffffffffffffff
<Doodle> That's because Mikau isn't here.
*** Mikau has joined #mfgg


mariobro27 Pikax and love are not compatible, OK?
PMEmail Poster
Top
Unspecified
mario4ever
Posted: Sep 5 2008, 07:37 PM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


Thanks, I got the mouse collison to work right. I'm not good a coding, but I think the more I practice, the more I understand.


--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
Unspecified
mario4ever
Posted: Sep 6 2008, 10:08 AM
Quote Post


Standard Member
[*]

Group Icon
Group: Members
Posts: 76
Member No.: 4932
Joined: 21-February 08

Status: (0d) [--]


I'm trying to make winged ? blocks, right now I have it's movement the way I want, but I'm trying to make the solid block follow it, but no luck.

This is what It looks like:

user posted image



--------------------
"90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature"


PM
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0626 ]   [ 15 queries used ]   [ GZIP Enabled ]   [ Server Load: 2.23 ]