Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!

Join the forum, it's quick and easy

Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Log in

I forgot my password

Search
 
 

Display results as :
 


Rechercher Advanced Search

Site Hits
Free hit counter
These stats started at 0 on July 7th 2009
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: https://gameml.forumotion.com/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com

A simple code

5 posters

Go down

A simple code Empty A simple code

Post by The SNIC Wed Aug 12, 2009 5:09 pm

I have a new code priblem. There seem to be no errors with this code when I check. Bt when I start upo the game It has one;
Code:
if player.x < x
{sprite_index = spr_bad_guy
hspeed = 5}
else
{sprite_index = spr_bad_guya
hspeed = -5}
if position_meeting[x+2,y,wall] or position_meeting[x-2,y,wall]
vspeed = -10


Last edited by The SNIC on Sat Sep 12, 2009 8:33 am; edited 3 times in total (Reason for editing : Cuz there's a new problem w? a different code)
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by The SNIC Wed Aug 12, 2009 5:40 pm

I know people are watching right now
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by fooey Wed Aug 12, 2009 7:48 pm

*sneeze*
fooey
fooey
Moderator
Moderator

Posts : 1422
Points : 55590
GameML Reputation : 1
Join date : 2009-07-10
Age : 29
Location : here

Back to top Go down

A simple code Empty Re: A simple code

Post by The SNIC Thu Aug 13, 2009 8:19 am

No not whay I weanted
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by Vivi_IX Thu Aug 13, 2009 10:26 am

Have you tried this: (put in boss step event or wherever)
Code:

if distance_to_point(CHARACTOR.x,CHARACTOR.y) = PERFERED_DISTANCE
{PUT_ACTIONS HERE}
Vivi_IX
Vivi_IX
Tres GameML Ninja
Tres GameML Ninja

Posts : 164
Points : 54318
GameML Reputation : 14
Join date : 2009-07-09
Age : 34
Location : USA: Painesville, Ohio

http://www.yoyogames.com/members/Vivi_IX

Back to top Go down

A simple code Empty Re: A simple code

Post by The SNIC Thu Aug 13, 2009 10:55 am

That's a lot less complex than my original but, the "action" part is difficult I can't get the character to follow him! Or go down without him moving but I still want it to pause.
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by The SNIC Thu Aug 13, 2009 11:04 am

Code:
if distance_to_point(object0.x,object0.y) = 11
{
 for (object0) x = boss.x
 for (object0) y = object0.y
 for (object0) vspeed = 20
 vspeed = 20
}
problem: ERROR at line 3 pos 15: assignment operater expected.
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by gogame1315 Thu Aug 13, 2009 12:19 pm

The SNIC wrote:
Code:
if distance_to_point(object0.x,object0.y) = 11
{
 for (object0) x = boss.x
 for (object0) y = object0.y
 for (object0) vspeed = 20
 vspeed = 20
}
problem: ERROR at line 3 pos 15: assignment operater expected.
Try changing "for" to "with" ?
gogame1315
gogame1315
GameML Adventurer
GameML Adventurer

Posts : 103
Points : 56235
GameML Reputation : 10
Join date : 2009-07-10
Age : 28

http://www.yoyogames.com/members/gamesgo1315

Back to top Go down

A simple code Empty Re: A simple code

Post by fooey Thu Aug 13, 2009 1:05 pm

um...yes i agree
fooey
fooey
Moderator
Moderator

Posts : 1422
Points : 55590
GameML Reputation : 1
Join date : 2009-07-10
Age : 29
Location : here

Back to top Go down

A simple code Empty Re: A simple code

Post by Vivi_IX Thu Aug 13, 2009 8:33 pm

I agree as well. The for statement is a looping statement with different syntax as well as function. When using the "with" statement format it like this:

Code:
if distance_to_point(object0.x,object0.y) = 11
{
  with(object0)
  {
    x = boss.x
    y = object0.y
    vspeed = 20
  }
  vspeed = 20
}
Vivi_IX
Vivi_IX
Tres GameML Ninja
Tres GameML Ninja

Posts : 164
Points : 54318
GameML Reputation : 14
Join date : 2009-07-09
Age : 34
Location : USA: Painesville, Ohio

http://www.yoyogames.com/members/Vivi_IX

Back to top Go down

A simple code Empty Re: A simple code

Post by The SNIC Sat Aug 15, 2009 9:34 pm

Wow, thanks Vivi_IX. That actually worked! Smile
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by The Dark Ninja Sun Aug 16, 2009 11:10 am

good it worked
The Dark Ninja
The Dark Ninja
Super 500 GML
Super 500 GML

Posts : 1495
Points : 56984
GameML Reputation : 7
Join date : 2009-06-16
Location : Earth

http://www.thedakninja.tastyhamgames.com

Back to top Go down

A simple code Empty Topic recap:

Post by The SNIC Sat Sep 12, 2009 8:38 am

I have a new code priblem. There seem to be no errors with this code when I check. But when I start up the game It has one:

Code:
if player.x < x
{sprite_index = spr_bad_guy
hspeed = 5}
else
{sprite_index = spr_bad_guya
hspeed = -5}
if position_meeting[x+2,y,wall] or position_meeting[x-2,y,wall]
vspeed = -10
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by gogame1315 Sat Sep 12, 2009 9:02 am

The SNIC wrote:I have a new code priblem. There seem to be no errors with this code when I check. But when I start up the game It has one:

Code:
if player.x < x
{sprite_index = spr_bad_guy
hspeed = 5}
else
{sprite_index = spr_bad_guya
hspeed = -5}
if position_meeting[x+2,y,wall] or position_meeting[x-2,y,wall]
vspeed = -10
try changing the "[" to "("
gogame1315
gogame1315
GameML Adventurer
GameML Adventurer

Posts : 103
Points : 56235
GameML Reputation : 10
Join date : 2009-07-10
Age : 28

http://www.yoyogames.com/members/gamesgo1315

Back to top Go down

A simple code Empty Re: A simple code

Post by The SNIC Sat Sep 12, 2009 10:03 am

huh? I didn't see thaqt there...
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by The SNIC Sat Sep 12, 2009 10:11 am

it worked Very Happy
The SNIC
The SNIC
Moderator
Moderator

Posts : 677
Points : 54890
GameML Reputation : 4
Join date : 2009-07-10
Age : 1014
Location : MI

https://www.youtube.com/gigaroid

Back to top Go down

A simple code Empty Re: A simple code

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum