Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> *SOLVED* Help with Game Maker
United States
Toodles
Posted: Apr 30 2006, 08:51 PM
Quote Post


Awesome.
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3587
Member No.: 2033
Joined: 23-April 06

Status: (0d) [--]


I tried asking this on the Game Maker Community, but it ended up getting pushed down really far before it got answered! (I hate how fast things get posted on there!) Anyway, here is my question. I'm working on a new Mario engine that is similar to the original SMB for NES. The problem is that there is one bug that I simply can't fix. I know what I need to do to fix it, but I'm not sure how to do it. I need to make it so that Mario's hspeed and friction are set to 0 when he hits the side of a block. Not the top or the bottom, just the side. Any ideas?

This post has been edited by toodles_team on May 1 2006, 02:47 PM


--------------------
user posted image
Feel like drawing good 'ol Toodles the Horse? Well, you might want a ref! And, because he's so photogenic, here's
another one!
PM
Top
United States
Littlink
Posted: Apr 30 2006, 09:30 PM
Quote Post


hip 2b square
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 5146
Member No.: 2010
Joined: 11-April 06

Status: (0d) [--]


If place_meeting(x+hspeed,y,block_Obj)
{friction=0;hspeed=0}

Like that? Put that in the step event. It will check for blocks in front of Mario and set his friction and hspeed to 0 if there is a block.

I hope that helps!


--------------------
[████████░░] 80%

user posted image
PMUsers WebsiteMSN
Top
United States
Toodles
Posted: May 1 2006, 01:54 PM
Quote Post


Awesome.
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3587
Member No.: 2033
Joined: 23-April 06

Status: (0d) [--]


Thanks for the help, but all I get is an error. I says:

at position 4: Assignment operator expected

...whatever that means. (I know almost nothing about GML. And yes, I did change the block_Obj part to the name of my block, which I lovingly named object6 laugh3.gif .) Any thoughts? I'd like to get this working because it sounds like it will do the trick!

This post has been edited by toodles_team on May 1 2006, 01:55 PM


--------------------
user posted image
Feel like drawing good 'ol Toodles the Horse? Well, you might want a ref! And, because he's so photogenic, here's
another one!
PM
Top
United States
Littlink
Posted: May 1 2006, 02:15 PM
Quote Post


hip 2b square
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 5146
Member No.: 2010
Joined: 11-April 06

Status: (0d) [--]


I might have to check the game out istelf. There might be a simple tying error that GM reads as a "Fatal error".


--------------------
[████████░░] 80%

user posted image
PMUsers WebsiteMSN
Top
United States
Toodles
Posted: May 1 2006, 02:23 PM
Quote Post


Awesome.
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3587
Member No.: 2033
Joined: 23-April 06

Status: (0d) [--]


Ok, check it out. Good luck, though. It's a mess! (Everything is drag and drop.) If it's going to take massive changes and reprograming to get it in fine working condition, don't bother. I have other games I can make.

By the way, mario's alarm 1 event is not being used. I was more or less "storing" possible fixes to that glitch there, so it doesn't ever do anything.

Attached File ( Number of downloads: 1 )
Attached File  8_bit_Super_Mario_Bros..gmd


--------------------
user posted image
Feel like drawing good 'ol Toodles the Horse? Well, you might want a ref! And, because he's so photogenic, here's
another one!
PM
Top
Unspecified
Morshu McPhereson
Posted: May 1 2006, 02:25 PM
Quote Post


Who's got the sweetest disposition?
[*]

Group Icon
Group: Members
Posts: 20184
Member No.: 685
Joined: 23-November 04

Status: (0d) [--]


The problem was, If can't be capitalized.

This post has been edited by Mason on May 1 2006, 02:32 PM
PMEmail Poster
Top
United States
Toodles
Posted: May 1 2006, 02:29 PM
Quote Post


Awesome.
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3587
Member No.: 2033
Joined: 23-April 06

Status: (0d) [--]


Again, thanks for trying, but it didn't work. With that code in place, I couldn't move at all!


--------------------
user posted image
Feel like drawing good 'ol Toodles the Horse? Well, you might want a ref! And, because he's so photogenic, here's
another one!
PM
Top
Unspecified
Morshu McPhereson
Posted: May 1 2006, 02:32 PM
Quote Post


Who's got the sweetest disposition?
[*]

Group Icon
Group: Members
Posts: 20184
Member No.: 685
Joined: 23-November 04

Status: (0d) [--]


QUOTE (toodles_team @ May 1 2006, 02:29 PM)
Again, thanks for trying, but it didn't work. With that code in place, I couldn't move at all!

Sorry I screwed up, here:

CODE
if place_meeting(x+hspeed,y,block_Obj)
{friction=0;hspeed=0}


Same as Littlelink's code, just no capital I.
PMEmail Poster
Top
United States
Toodles
Posted: May 1 2006, 02:47 PM
Quote Post


Awesome.
[*][*][*][*][*]
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3587
Member No.: 2033
Joined: 23-April 06

Status: (0d) [--]


IT WORKED!!!!!!!!!!!!!!!!! YES!!!! HUZZAH!!!!!!

Thank you so much! Littlink and Mason, you are lifesavers!!! Am I being too dramatic? No seriously, I tried at least 20,000 different things to fix that stupid glitch and none of them worked! I thought it was un-fixable! Boy, am I glad I was wrong!!!! YES!! THANK YOU!!! THANK YOU!!! THANK YOU!!!


--------------------
user posted image
Feel like drawing good 'ol Toodles the Horse? Well, you might want a ref! And, because he's so photogenic, here's
another one!
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.0496 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 3.66 ]