Discuss Scratch

alc0001gsc
New to Scratch
3 posts

Enemies

I want to create enemies in my game. http://scratch.mit.edu/projects/12039294/
However, with the enemy I have in my game,it always follows me and I have tried everything to make it glide in one place.

Sprite 37::

Code:

when FLAG clicked
show
forever
  • set x to (SCROLLX) + 480 * 0.9
    go t x: 73 y: -41
    glide 2 secs to x: 117 y: -41
    glide 2 secs to x: 100 y: -41
    change x by -10






Please help!
Thank you.

Last edited by alc0001gsc (Sept. 12, 2013 02:01:50)

JAVAProgramming
Scratcher
100+ posts

Enemies

You have him set with coordinates, so he is doing what you asked him to do.
You need to set him to a ScrollX place. I don't really know how to explain it, but, the background is not using coordinates to glide to or anything, it's based off of something called ScrollX, which, is essentially, a separate coordinate, that the background, or level is going to. I know that wasn't a good explanation, so I'm sorry if I just confused you more!

My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
alc0001gsc
New to Scratch
3 posts

Enemies

Thanks!
But I've already done that and it still doesn't work.
JAVAProgramming
Scratcher
100+ posts

Enemies

alc0001gsc wrote:

Thanks!
But I've already done that and it still doesn't work.
You sure?

My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
JAVAProgramming
Scratcher
100+ posts

Enemies

I think you need to solely base your movement off of the ScrollX or you need two other sprites, when touching, switch move 10, to move -10 and so on, so forth.


My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
alc0001gsc
New to Scratch
3 posts

Enemies

Alright, thanks I will try that!
JAVAProgramming
Scratcher
100+ posts

Enemies

alc0001gsc wrote:

Alright, thanks I will try that!
If that doesn't work, I don't know what will…


My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
toto5065
Scratcher
5 posts

Enemies

JAVAProgramming wrote:

You have him set with coordinates, so he is doing what you asked him to do.
You need to set him to a ScrollX place. I don't really know how to explain it, but, the background is not using coordinates to glide to or anything, it's based off of something called ScrollX, which, is essentially, a separate coordinate, that the background, or level is going to. I know that wasn't a good explanation, so I'm sorry if I just confused you more!
when FLAG clicked
show
forever

set x to (SCROLLX) + 480 * 0.9
go t x: 73 y: -41
glide 2 secs to x: 117 y: -41
glide 2 secs to x: 100 y: -41
change x by -10
Please Click Play to Code this

FIRST GAME!
toto5065
Scratcher
5 posts

Enemies

JAVAProgramming wrote:

alc0001gsc wrote:

Alright, thanks I will try that!
If that doesn't work, I don't know what will…

given its you JAVAProgramming

FIRST GAME!
toto5065
Scratcher
5 posts

Enemies

*:):|:(:D:o;):/:P:lol::mad::rolleyes::cool:

FIRST GAME!
Splodgey
Scratcher
100+ posts

Enemies

toto5065 wrote:

*:):|:(:D:o;):/:P:lol::mad::rolleyes::cool:
Please don't make posts like that…

toto5065 wrote:

JAVAProgramming wrote:

alc0001gsc wrote:

Alright, thanks I will try that!
If that doesn't work, I don't know what will…

given its you JAVAProgramming
It's best to use the edit button on your previous post, rather than double-posting

Ever wondered why there's no text box? Or why you can make sprites “say” stuff, but not display pure text? Click here! Now v1.3, includes links!
Text Box, Calculator, AlphaSorter & Case Sensor
Have a large-scale Minecraft project and you want to know how much raw materials you need to craft the “ingredients”? Click here!

Minecraft PvP Weapon Vs Armour Calculator/Simulator

Powered by DjangoBB