I'm making an X/ Y scrolling game. It is Pokemon style meaning you play it from a birds eye view.
Anyway, I want to place a person into my game but I don't know how to position him so he will stay there.
The X and Y scrolling script is the traditional method meaning it's like this for the backgrounds:
when gf clicked forever go to x: <<(xscroll)> + <(480)*(0)>> y: <<(yscroll)> + <(360)*(0)>> endand I change the 0's with numbers for the positioning. I tried doing that with the NPC but he kept moving with the background when my character moved/ background moved
Offline
just don't put any movement scripts in the person then place him in the location you want him in
so just take out the scrolling scripts in the person and then he will stay still while the background moves
Offline
Hmm.. You'll have to have the sprite forever glint to a location in relation to the sctolling sprite
Offline
DimensionOS wrote:
I'm making an X/ Y scrolling game. It is Pokemon style meaning you play it from a birds eye view.
Anyway, I want to place a person into my game but I don't know how to position him so he will stay there.
The X and Y scrolling script is the traditional method meaning it's like this for the backgrounds:when gf clicked forever go to x: <<(xscroll)> + <(480)*(0)>> y: <<(yscroll)> + <(360)*(0)>> endand I change the 0's with numbers for the positioning. I tried doing that with the NPC but he kept moving with the background when my character moved/ background moved
Please help
just don't do it with the NPC and it'll be fine
Offline
you would do
when gf clicked forever go to x:<xscroll> + 480 * 0 + <x> y: <yscroll> + 360 * 0 + <y> endx and y would be personal variables.
Last edited by sccar3 (2012-03-15 19:31:24)
Offline
Exactly, I did it with my mario scroller: http://scratch.mit.edu/projects/itsmomito/1120339
I made that a long time ago, but you can download it and take a look at the npc scripts. I'll take a look later and give you the script I used.
Offline
Ahh Now I remember what I did:
First, I created a variable for the movement of the npc, in my case in was a goomba from Mario So I named it Goomba Move.
Then I created this script in the goomba (sorry I just got back on scratch. Im not sure how to use Scratch Blocks yet):
When Flag Clicked
Forever
Set X to Goomba Move + ScrollX + 160
End
The 160 is just the relative location on the screen with Scroll x. For example: if it was 300, the goomba would just be farther to the right. Goomba Move is for the Goomba to move. I Made a script so that it only moves when he is in the screen area. I also made a script to hide the goomba if his x is too far from the player to be on the screen. There you go! That's all there is to it.
Last edited by itsmomito (2012-03-15 19:51:24)
Offline