dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: ::ocean intro::

  1. #1
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149

    ::ocean intro::

    ok here is what i have so far: swf, fla

    what i want to do is have it so that when the map gets to the border of the movie, the map stops scrolling. ive been messing with hitTest and stuff, but cant quite get it to work. i can make it stop when it gets to the edge, but then it wont 'let go' and let me go back the other way. anyone have any ideas?

    thanks..

    -frank

  2. #2
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    well something like this should work

    if(_root.background._x>=maxx){_root.background._x= maxx}
    else
    if(_root.background._x<=minx){_root.background._x= minx}

    where background._x is the moving background _x
    maxx is the maximum background _x // lets say 550
    minx is the minimum background _x // lets say 0

    apply the same principle for the _y directions

  3. #3
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    AWWWWW.. man thats so obvious.. i didnt even think about that. then again i havnt touched flash in 7 months (well till last week). thanks again mag (you've helped me a bunch before)

    -frank

  4. #4
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    Originally posted by DJ-Anakin
    AWWWWW.. man thats so obvious.. i didnt even think about that. then again i havnt touched flash in 7 months (well till last week). thanks again mag (you've helped me a bunch before)

    -frank
    my pleasure



    in your game the ufo its always in the center while the background moves

    now you need to set a maxscroll_x variable for the background and a maxscroll_x for the ufo so if the background stops scrolling the ufo can still move untill it reaches the edge
    of course this goes for both directions left and right
    you also need to do this for the _y directions too
    so you can move freely inside the playground even if the background stops

    hope that helps

  5. #5
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    that exactly what i was plannin on doin.. just hadnt thot about how..

    i dont understand what you mean.. i mean, i understand what you mean by the maxscroll_x.. but ho wwoul di go about puttin that int he code? like this?

    if (_root.ground._x) == maxx or minx{
    movement code here pointing to ship?
    }else{
    movement code here pointing to ground?
    }

    but how would i say 'max or minx'? can i just say 'or'?

    i cant believe how much ive forgotten in the past year.. (not seven months as thot before)..

    -frank

  6. #6
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    anyone? magnetos? help. i cant quite get it.

    anyways.. to the top..

    -frank

  7. #7
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    Originally posted by DJ-Anakin
    anyone? magnetos? help. i cant quite get it.

    anyways.. to the top..

    -frank
    hey dj sorry i tought you figureed it out by now
    ok i just got home from work gimme an hour and i ll get back to you

    in th meantime if somebody wants to help is welcome

  8. #8
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    dude! thanks. like i said before.. i've forgotten so much in the year..

    i need to start workin on my unfinished star wars side scrolling atst game.

    -frank

  9. #9
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    sorry dj for making you wait but i was trying to figure it out how to do that and somehow i got stuck
    the solution its quite simple but i cant seem to make the code work
    damn it

    its just a damn set of ifs

    if ground reaches end ground stops//thats easy
    if ground stops ship _x move// thats easy
    if ship reaches stage edge ship stops//thats easy

    here is my coding problem

    ground stops until ship is back to center of stage
    if ship is centered ground can move again

    well i'll try my best later on.. maybe this weekend
    hopefully somebody will help you by then

    also would help a lot if you explain what your finished game will look like !

  10. #10
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    see. thats why im hung up. im stuck at the exact same part. is there maybe a way to make it, so that when the ufo gets a certain distance from the edge, the 'screen' will slide, or bounce back to center the ufo? i cant think of any.. im gonna search on here, see if anyone else has anything like it and see what they did to overcome this problem.

    its not really a game, more of an exploration type thing. its the splash page for my site. ive got a couple easter eggs hidden, some hot keys that do stuff, some things happen when you fly over certain spots.. just figured i hadnt seen anything like this on here. i've been wantin to put it together for a while, just never did..

    so.. ok.. im goin to search.. thanks again

    //edit: what about maybe puttin a circle inthe middle, say dia. 100px, and when it goes inside that circle, it restores movement to the ground? anyone else have any ideas? this is really buggin the hell outta me. thnx.

    -frank
    Last edited by DJ-Anakin; 02-27-2003 at 04:46 PM.

  11. #11
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    does this helps?
    Attached Files Attached Files

  12. #12
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    um.. i dunno.. it will help with the borders, but i would still like to make it so you have freeplay when the playground reaches the edge.

    thanks.. ill see what i can do and post again later..

    //edit: hey marmotte managed to do what i needed. check it. when you get to the edge of the map then the character can still move around. i wonder if i can adapt that for my purposes. http://flashkit.com/board/showthread...hreadid=428346 is the thread.

    -frank
    Last edited by DJ-Anakin; 02-28-2003 at 01:33 PM.

  13. #13
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601
    DJ-Anakin, here's one way of doing it, see my attached fla.

    also, if you check my zelda open source (the link in my signature), you'll also have another example of scrolling like you want, coded a bit differently... plus 4 directions ^^
    Attached Files Attached Files

  14. #14
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    dude! that totally will work. i just put it into my code, added UP and DOWN and it mostly works.. i just gotta edit it so that the ship only moves around if the border is touching the edge of the map.. shouldnt be hard.. ill post what i got so far later! thanks..

    -frank

  15. #15
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    hey dj i did it all over using my code this time
    is this what you were looking for?
    http://digilander.libero.it/magneto1/scrollTest.html

    its 4kb no preloader though
    if you or any body wants this fla just let me know

    ps how is your site/game coming?
    Last edited by magnetos; 03-01-2003 at 06:34 PM.

  16. #16
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    ya, thats pretty close. can you send me the fla? either attach it or email it to me? boisvert@freeshell.org

    i havnt been able to work on it this weekend. been too busy. still puttin stuff away in my new house..

    so.. i will work on it tomorrow.

    why is your file size so big? cause of the graphics? they dont seem like they would be that big in size.. :shrug:

    thanks again. ill post the game tomorrow if i get a chance to work on it. which i should.

    -frank

    <--- donut

  17. #17
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    okey dokey here is the fla only 31 kb and the swf i think its 7kb so its veeery small thats because there arent any pictures in it
    its all vectors

    http://digilander.libero.it/magneto1/scrollEdge2.fla
    i am not entirely satisfyed with this fla but it works
    enjoy it

  18. #18
    booooosted! DJ-Anakin's Avatar
    Join Date
    Oct 2000
    Location
    ridgecrest, ca [pm me if in cali desert]
    Posts
    149
    cool.. thanks alot..

    so in building this thing, did i come up with a new, thing, like play type [making the screen scroll like it does]? im sure i didnt..

    once i get this done, i wanna redo my star wars game, then im gonna make another star wars one..

    anyways.. lemme try this.. thanks again...

    -frank

  19. #19
    Senior Member milowerx's Avatar
    Join Date
    May 2002
    Location
    Los Angeles
    Posts
    278
    I'd like a copy! That's an awesome lil' setup. So fast as well. Can you e-mail me a copy when you get a chance?
    -Mike
    =============================

    FLASH PORTFOLIO

    DESIGN PORTFOLIO

    STORYBOARDS

    FILMS

  20. #20
    Senior Member milowerx's Avatar
    Join Date
    May 2002
    Location
    Los Angeles
    Posts
    278
    Whoops. Didn't see the link. Sorry!
    -Mike
    =============================

    FLASH PORTFOLIO

    DESIGN PORTFOLIO

    STORYBOARDS

    FILMS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center