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!
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: http://gameml.iowoi.org/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com
Keywords


A simple code

View previous topic View next topic Go down

A simple code

Post by The SNIC on 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)
avatar
The SNIC
Moderator
Moderator

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

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

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

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

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

*sneeze*

_________________
we are the champions - my friends
And we'll keep on fighting - till the end -
We are the champions -
We are the champions
No time for losers
'Cause we are the champions - of the world -
avatar
fooey
Moderator
Moderator

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

View user profile

Back to top Go down

Re: A simple code

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

No not whay I weanted
avatar
The SNIC
Moderator
Moderator

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

Post by Vivi_IX on 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}
avatar
Vivi_IX
Tres GameML Ninja
Tres GameML Ninja

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

View user profile http://www.yoyogames.com/members/Vivi_IX

Back to top Go down

Re: A simple code

Post by The SNIC on 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.
avatar
The SNIC
Moderator
Moderator

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

Post by The SNIC on 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.
avatar
The SNIC
Moderator
Moderator

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

Post by gogame1315 on 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" ?
avatar
gogame1315
GameML Adventurer
GameML Adventurer

Posts : 103
Points : 31795
GameML Reputation : 10
Join date : 2009-07-10
Age : 21

View user profile http://www.yoyogames.com/members/gamesgo1315

Back to top Go down

Re: A simple code

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

um...yes i agree

_________________
we are the champions - my friends
And we'll keep on fighting - till the end -
We are the champions -
We are the champions
No time for losers
'Cause we are the champions - of the world -
avatar
fooey
Moderator
Moderator

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

View user profile

Back to top Go down

Re: A simple code

Post by Vivi_IX on 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
}
avatar
Vivi_IX
Tres GameML Ninja
Tres GameML Ninja

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

View user profile http://www.yoyogames.com/members/Vivi_IX

Back to top Go down

Re: A simple code

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

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

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

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

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

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

View user profile http://www.thedakninja.tastyhamgames.com

Back to top Go down

Topic recap:

Post by The SNIC on 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

_________________
My site is new and good! and it's going to be able to host games and stuff! Check it out! http://cazigeneration.vampire-legend.com/index.htm
avatar
The SNIC
Moderator
Moderator

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

Post by gogame1315 on 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 "("
avatar
gogame1315
GameML Adventurer
GameML Adventurer

Posts : 103
Points : 31795
GameML Reputation : 10
Join date : 2009-07-10
Age : 21

View user profile http://www.yoyogames.com/members/gamesgo1315

Back to top Go down

Re: A simple code

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

huh? I didn't see thaqt there...

_________________
My site is new and good! and it's going to be able to host games and stuff! Check it out! http://cazigeneration.vampire-legend.com/index.htm
avatar
The SNIC
Moderator
Moderator

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

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

it worked Very Happy

_________________
My site is new and good! and it's going to be able to host games and stuff! Check it out! http://cazigeneration.vampire-legend.com/index.htm
avatar
The SNIC
Moderator
Moderator

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

View user profile http://www.youtube.com/gigaroid

Back to top Go down

Re: A simple code

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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