User Tag List

Results 1 to 7 of 7

Thread: Screen wrapping based on alterable value

  1. #1
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Screen wrapping based on alterable value

    It's 03:19 am, so forgive me if the solution is obvious.

    I have an object with two alterable values; Ypos and Yvel.

    The event in question; If Yvel<> 0
    -Set Ypos -> (Ypos+Yvel) mod 480
    -Set Y -> Ypos

    That works like a charm, but only when Yvel is a positive value i.e the object leaves the screen at the bottom.

    How on earth (or in space) do I set it up so it works in both directions?

    I'm stumped!
    //EE

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Screen wrapping based on alterable value

    Don't use mod. Just do:

    Yvel<>0
    - Set Ypos-> Max(0, Yvel/abs(Yvel)*480)

    or something.

  3. #3
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Screen wrapping based on alterable value

    Nope.
    Doesn't work.
    Thanks though!

  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Screen wrapping based on alterable value

    What does it do/What do you expect? What are you trying to achieve?

  5. #5
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Screen wrapping based on alterable value

    Ha! Just realized that I didn't state what I was aiming for in the initial post!

    I'm trying to make an object wrap around the screen if it leaves it on the top or bottom(the screen edge, not the frame). The problem is that the object has a variable velocity, making me have to tell it what coordinate to position at. You can think of it as a scrolling background without moving any objects but the background.

    As I said, it works perfectly when objects leave the screen bottom, the 'Mod' makes the Xpos value wrap nice. However, when Xpos<0 the mod function can't wrap it properly.

    Hope I was clear!

  6. #6
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Screen wrapping based on alterable value

    -Set Ypos -> (480+Ypos+Yvel) mod 480

  7. #7
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Screen wrapping based on alterable value

    Ha ha.. ah-ha.. ^__^

    So simple! Why didn't I think of that?

    Thanks!

    //EE

Similar Threads

  1. Tile based graphics versus using full screen pictures. How is performance affected?
    By Yima in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 14th August 2013, 09:33 AM
  2. Touch based platformer (no on-screen buttons) Has this been done before?
    By Pineapple in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 22nd February 2012, 08:56 AM
  3. Display values on screen from Alterable Values
    By mikeh in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 13th May 2008, 01:59 PM
  4. Alterable Strings and Alterable Values limit :(
    By Pedro Almeida in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 13th October 2006, 06:38 AM

Posting Permissions

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