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

#1 2013-01-14 21:47:04

Rockyoyo14
Scratcher
Registered: 2012-11-02
Posts: 3

How Do I Make a Sprite Appear where you are

Btw I am making a mario game and trying to make a fireball appear right in front of the sprite and dont forget i am walking to....

Offline

 

#2 2013-01-14 22:39:43

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: How Do I Make a Sprite Appear where you are

One way is just to have another costume that shows the character with a fireball in front.  This works well if the character is moving, since the fireball will move with the character (since it's part of the costume). 

Another approach is to use a separate sprite for the fireball and have it go to the position of the character sprite

go to x: ([x position v] of  [sprite 1 v]) y: ([y position v] of  [sprite 1 v])
Of course, you may want to offset the position a bit by adding something to one or both coordinate parts  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2013-01-23 15:44:59

AgentCNF
Scratcher
Registered: 2012-08-27
Posts: 21

Re: How Do I Make a Sprite Appear where you are

Or a more simple way do do it.......

go to [sprite v]

Last edited by AgentCNF (2013-01-23 15:45:26)


Go St. Louis Cardinals!!! I Hate The Cubs!

Offline

 

#4 2013-01-23 16:38:43

Zebus
New Scratcher
Registered: 2013-01-21
Posts: 14

Re: How Do I Make a Sprite Appear where you are

try...

this will need to go on mario

when gf clicked
if <key[space v]pressed?>
 broadcast[fireball v]
end
this will need to go on the fire ball

when gf clicked
hide
when I recive[fireball v]
go to [mario v]
show
point towards (([direction v] of [mario v]) - [90] ) //<--or 180 to face right way 
repeat until <<touching [edge v]?> or <touching [goomba]?>>
 move [10] steps //<--you might want to use gravity explain below
end
if <touching[goomba v]?>
 broadcast[killgoomba v]
end
hide
and for the goomba

when I receive[killgoomba v]
hide
this will kill the goomba

not full proof but should be close to what you want just play with it

i am not to sure about how the gravity works yet but if you want the fire ball to fall when shot in the air like it does in the game i think that is what you will want

also shameless advertisment if you want to look at what i am working on

http://scratch.mit.edu/forums/viewtopic.php?id=113359

Offline

 

Board footer