Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Collision Problems, Game Maker
United States
kremling
Posted: Jul 7 2008, 07:26 PM
Quote Post


Casual Member
[*][*][*]

Group Icon
Group: Members
Posts: 923
Member No.: 3240
Joined: 28-January 07

Status: (0d) [--]


Hello, I have recently had a a problem with my engine where Mario jumps on a goomba. I am not using the collision event, I am using the step event.

CODE
if place_meeting(x,y+1,obj_goomba) and vspeed > obj_goomba.vspeed
{
vspeed = -6
}
else
{
if place_meeting(x,y,obj_goomba) and !vspeed > obj_goomba.vspeed
{
show_message('')
exit;
}}


If mario is high enough above the goomba and lands on him, then bounce.
But if he runs into the goomba, and he is not high enough, then show message.

I know I have to change the coordinates in the place meeting, but I dont know what to change it to. Thanks for the help!


--------------------
My Reference_1
Deviant Art
"Doing the wrong thing is always right"
Drawings by mfggers: Omnomlicous - Jazz - Bip
user posted image
PMEmail PosterUsers Website
Top
United States
Elyk
Posted: Jul 7 2008, 07:38 PM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 6604
Member No.: 3808
Joined: 22-May 07

Status: (0d) [--]


what's your problem exactly?

This post has been edited by Elyk on Jul 7 2008, 07:39 PM


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
kremling
Posted: Jul 7 2008, 07:43 PM
Quote Post


Casual Member
[*][*][*]

Group Icon
Group: Members
Posts: 923
Member No.: 3240
Joined: 28-January 07

Status: (0d) [--]


When Mario runs into the goomba, it doesn't do anything, but when he does jump on the goomba the message pops up.


--------------------
My Reference_1
Deviant Art
"Doing the wrong thing is always right"
Drawings by mfggers: Omnomlicous - Jazz - Bip
user posted image
PMEmail PosterUsers Website
Top
United States
Elyk
Posted: Jul 7 2008, 07:44 PM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 6604
Member No.: 3808
Joined: 22-May 07

Status: (0d) [--]


I just tried it in GM6 and it worked fine.

although
for the second event (show message) you can try to detect x+hspeed rather than x and try setting the hspeed to 0 when you show the message so you don't get it multiple times

This post has been edited by Elyk on Jul 7 2008, 07:44 PM


--------------------
user posted image
PMEmail PosterUsers WebsiteAOLMSN
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.0407 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 2.25 ]