Topic:   Is there?   (Read 18730 times)


0 Members and 1 Guest are viewing this topic.

Chamez


  • GMG Newbie

  • *


  • Posts: 31

  • The Town Noob
Is there?
« on: May 23, 2010, 07:50:09 PM »
Is there an if sprite on X,Y then DO command in Sc?
I am the noob... Fear my stupid questions.

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: Is there?
« Reply #1 on: May 23, 2010, 08:03:11 PM »
Code: [Select]
IF SPRITEX spritenum = x THEN
IF SPRITEY spritenum = y THEN
do whatever
END IF
END IF
« Last Edit: May 23, 2010, 08:03:40 PM by WarHampster »

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Is there?
« Reply #2 on: May 23, 2010, 08:47:30 PM »
if spritex(1)=number then
if spritey(1)=number then
execute code
end if
end if

but its difficult to pinpoint exact coordinates depending on what your doing, so you might want to make it execute if sprite is within a 50 pixel radius

if spritex(1)>50 then
if spritex(1)<100 then
if spritey(1)>50 then
if spritey(1)<100 then
code
end if
end if
end if
end if

or you can execute code when any part of the sprite touches a coordinate
if spritetouchingxy(1,x,y)=true then
code
end if

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Is there?
« Reply #3 on: May 24, 2010, 10:00:16 PM »
SOMEONE needs to make a good newbie tutorial for SC. In fact, maybe I should start on that project! :D
BTW, I asked a lot of the same questions, so look through this forum for some more tips.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Is there?
« Reply #4 on: May 25, 2010, 12:32:05 AM »
I just had an idea for a new event: Sprite Moved.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Is there?
« Reply #5 on: May 25, 2010, 03:22:30 PM »
Hey Mike, you've totally gotta add a Make Game command to the next update. SC's minimal capabilities hinder my creativity.
« Last Edit: May 25, 2010, 03:24:01 PM by Silverwind »
I survived the spammage of 2007