This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-10-15 09:53:20

SJRCS11_010
Scratcher
Registered: 2011-01-24
Posts: 100+

Moving Enemys in a scolling game

I need help on making moving enemys in a scrolling game
PLEASE HELP


"The Definition of Insanity is doing the same thing over and over again and expecting different results." - Albert Einstein

Offline

 

#2 2011-10-15 09:59:14

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Moving Enemys in a scolling game

The easiest way is to use relative positions.
Make 2 sprite variables called xpos and ypos, and tell the sprite to forever go to
x: scrollx + xpos y: scrolly + ypos

Then use xpos and ypos as if they were your real x and y position variables. That didn't make sense, did it?  hmm

Offline

 

#3 2011-10-15 10:08:18

SJRCS11_010
Scratcher
Registered: 2011-01-24
Posts: 100+

Re: Moving Enemys in a scolling game

LS97 wrote:

The easiest way is to use relative positions.
Make 2 sprite variables called xpos and ypos, and tell the sprite to forever go to
x: scrollx + xpos y: scrolly + ypos

Then use xpos and ypos as if they were your real x and y position variables. That didn't make sense, did it?  hmm

Thanks! I actually might have thought of a different way to do it, but if it dosn't work I'll use this.


"The Definition of Insanity is doing the same thing over and over again and expecting different results." - Albert Einstein

Offline

 

#4 2011-10-15 11:05:15

rojasscratches
Scratcher
Registered: 2011-06-01
Posts: 59

Re: Moving Enemys in a scolling game

i asked the same thing a while ago and was answered see Keleimiser said
http://scratch.mit.edu/forums/viewtopic.php?id=67809


smile   neutral   sad   big_smile   yikes   wink   hmm   tongue   lol   mad   roll   cool  cool  Scratch Home Page  cool

Offline

 

#5 2011-10-15 11:31:49

SJRCS11_010
Scratcher
Registered: 2011-01-24
Posts: 100+

Re: Moving Enemys in a scolling game

rojasscratches wrote:

i asked the same thing a while ago and was answered see Keleimiser said
http://scratch.mit.edu/forums/viewtopic.php?id=67809

Thanks!


"The Definition of Insanity is doing the same thing over and over again and expecting different results." - Albert Einstein

Offline

 

#6 2011-10-15 15:50:16

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Moving Enemys in a scolling game

SJRCS11_010 wrote:

rojasscratches wrote:

i asked the same thing a while ago and was answered see Keleimiser said
http://scratch.mit.edu/forums/viewtopic.php?id=67809

Thanks!

I basically said the same thing, but kiley's version has cool images  tongue

Last edited by LS97 (2011-10-15 15:50:44)

Offline

 

#7 2011-10-16 08:28:34

kodarr
New Scratcher
Registered: 2011-10-02
Posts: 18

Re: Moving Enemys in a scolling game

I'm having layer problems but enemy moving in this scrolling game is working if you need code reference.  All I have on here so far is scrolling background and moving an enemy so shouldn't be hard to decipher it all.
http://scratch.mit.edu/projects/kodarr/2062825

Offline

 

Board footer