PDA

View Full Version : SORRY one more thing missing



coolmarco2004x
October 5th, 2004, 01:31 PM
hi,
sorry for posting so many threads but this is the last thing.
my game will be in a sight from the top and a bit to the side like cinderfall or diablo if you know
well
what do i do so that it scrolls?
i dont only want to know that i also want to know how to do so that when you walk against a building it stops scrolling(thats my main problem)
i normally do a code like this:
if (key.isDown(Key.RIGHT)
_root._x+=10
}
}
this does so that the screen scrolls when im walking(if something is wrong in the code its just an example
well,when i walk against a building it still scrolls(if im still pressing the button for the man to walk)but the man stays there because i did a code so that he doesnt go through the building.how do i do so that it stops scrolling when im walking against the building?
please help
if you dont understand just ask what you dont understand
thanks

TheOneAndOnly
October 5th, 2004, 06:14 PM
i dont know the answer to your question but FYI the "Top side" view is called isometric :D

Dr Warm
October 5th, 2004, 11:17 PM
really what u speak of won't be the easiest thing in the world and will always turn out kind of dodgy, have u found out even how to check if a the char is next to a wall, have u only got one instance name for the wall, ie is it just one big thing or is it made up of lots of little lines, with names like line1, line2 line3 etc cos u'll need it like that, to my knowledge anyway

I think if u want to be able to do this u'll need to use tiles, but i've seen other methods using art-based, but i don't know how to do them

coolmarco2004x
October 6th, 2004, 10:37 AM
you know what i could also do?
i could do that with a key press the screen scrolls a bit so you have to scroll it yourself
yeah ill do that!
thanks for all the help!

Dr Warm
October 6th, 2004, 09:34 PM
what do u mean scroll it yourself? with the mouse, cos that would actually be pretty cool

coolmarco2004x
October 7th, 2004, 12:00 PM
no with some keys
you press a button and then every single thing moves up,to the side,etc
i need to know how to do that if you press a button everything moves so that its like scrolling but i dont want to put the code in every single thing
how do i do so that i dont have to put the code in every single thing?
please help
thanks

Dr Warm
October 7th, 2004, 08:29 PM
i don't really know what ur talking about, cos the code will be different for each way of scrolling, like if u want left it'll scroll left, press right it'll scroll right etc. but u can make this easier with a function.
in the main timeline have
_root.onEnterFrame = function(){
if(Key.IsDown(Key.LEFT)){
scrolling(left);
}
if(Key.IsDown(Key.RIGHT)){
scrolling(right);
}
//etc
}
scrolling = function(direction){
dir = direction;
if(dir == "left"){
movement = 5;
}
if(dir == "right"){
movement = -5;
}
_root += movement;
}
or something like this