User Tag List

Results 1 to 4 of 4

Thread: Attempting to 'move' all onscreen objects...

  1. #1
    No Products Registered

    Join Date
    Sep 2008
    Location
    Colorado, USA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Attempting to 'move' all onscreen objects...

    Writing a simple scrolling shooter that wraps the 'world' in all directions ala 'Sinistar' or C64 'Survivor'.

    Wrapping the world is the easy part...when the player reaches a particular x or y at either extent, I move him to the opposite extent of the map, and it appears that the 'world' just keeps going.

    My problem is moving all the active objects on the screen along with the player when he 'wraps'.

    Right now, I'm attempting to move just one active object type, an enemy ship that chases the player around, but there can be multiple instances of this enemy ship onscreen at once and that is where the problem appears, not all the ships are being moved, so they just 'disappear' when the player 'wraps'.

    Here is what I'm doing in pseudocode (only showing x wrapping for one direction):

    Always set globalVarWrapX = playerX
    set globalVarWrapY = playerY

    if playerX>2880 then globalVarWrap = 1
    globalVarWrapX = 320

    if globalVarWrap = 1 then

    ' save the offset of the enemy ship from the player ship
    set enemyShip xOffset = enemyShipX-playerX
    set enemyShip yOffset = enemyShipY-playerY

    ' move the player to the other side of the screen
    set playerX = globalVarWrapX
    set playerY = globalVarWrapY

    ' move the enemy ships to the other side of the screen
    set enemyShipX = playerX+enemyShip xOffset
    set enemyShipY = playerY+enemyShip yOffset

    set globalVarWrap = 0

    endif

    It appears that when there is just one enemy ship, this works fine, but two or more and only one of the ships will make the 'wrap', the others just disappear. Any ideas?

    Thanks in advance!

    Gil

  2. #2
    No Products Registered

    Join Date
    Jul 2008
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Attempting to 'move' all onscreen objects...

    I think there's a widget called something like "Zelda type scrolling".

    Hope I helped!

  3. #3
    Clicker Fusion 2.5 Developer
    00J's Avatar
    Join Date
    Jun 2006
    Location
    Virginia, USA
    Posts
    1,510
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Attempting to 'move' all onscreen objects...

    try adding a qualifier to your ships and reference them from the qualifier.

    reference = enemy


  4. #4
    No Products Registered

    Join Date
    Sep 2008
    Location
    Colorado, USA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Attempting to 'move' all onscreen objects...

    OOJ, can you give me a more concrete example?

    Right now under the 'Create New Object' object, I am spawning a new 'enemyShip' every 15 seconds or so. How would I setup this 'qualifier' and then reference them from it?

    Thanks.

Similar Threads

  1. Making objects visible while onscreen, then hiding them while offscreen
    By Xeeko in forum iOS Export Module Version 2.0
    Replies: 11
    Last Post: 13th February 2013, 07:20 AM
  2. Objects move foward
    By oliversb in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th February 2012, 09:51 AM
  3. Enemy Move Around objects?
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 14th January 2012, 07:02 PM
  4. Move two objects
    By FlinkGigitty in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 17th August 2010, 06:10 PM
  5. Move objects to different folders.
    By Nifflas in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 27th September 2006, 03:00 PM

Posting Permissions

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