0 Favourites

Mini map issues need help

  • i am making a spaceship game, and i have a minimap working but not to the extent i want to.

    problem #1:

    I would like to be able to click the mini map and have the ship move to those coordinates(as in position on map relative to layout), but when i click it moves to the spot where i clicked on the screen as if the minimap wasn't there.

    Problem #2:

    I can get the mini map to show my ship position and 1 of the sprites but i can't get the map to show the all the randomly placed sprites on the map. i was wondering how i can plot the coordinates of all enemy sprites including the one that are spawned to replace the ones that i have destroyed.

    I'm sorry i'm new to this and have been looking for the solution to these problems but to no avail if someone could send me a link or explain how i can do this it would be appreciated.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • anyone?

  • Sorry, I doubt that anyone can help you with that, without seeing your code, ie. the CAPX

  • #1: Make sure in the clicking events, that when you normally click to move ship outside minimap, to check if it is not clicking the minimap.

    #2: Depends on how you implement the minimap and plotting. If you are using canvas, just plot a pixel for each live enemy. Be sure to clear between all ticks. Alternatively, if you use sprites, just create a sprite for each enemy that enters the minimap range and move it appropriately.

  • ok thanks i have been battleing this problem for a while now i will check out canvas and let you know what i come up with. i'll update if i figure the problem out.

    and currently i'm using the pics from a website and i'm not sure if i can get into trouble for using copyrighted pics. if you know let me know lol

    thanks to both replies.

  • #1 is just math.

    If the origin of your minimap sprite is at the top left then a mouse click can be converted to layout coordinates with these expressions:

    x:

    lerp(0,LayoutWidth, unlerp(minimap.X, minimap.X+minimap.Width, Mouse.X))

    y:

    lerp(0,LayoutHeight, unlerp(minimap.Y, minimap.Y+minimap.Height, Mouse.Y))

  • ok i'm still having lots of trouble with my sprites being put on the map. my code is as such(i can't post pics):

    for each sprite

    each tick:          canvas...draw point...

                        Canvas.X +Canvas.Width*(Sprite.X/LayoutWidth)

                        Canvas.Y +Canvas.Height*(Sprite.Y/LayoutHeight)   

    if anyone know what i'm doing wrong please let me know.

    Rojo: the map issue, i can't get to work because i'm not sure where to put that code i have tried in various places but there is no reaction when i click the map, my ship still moves to the spot i click behind the map. even when i disable my normal movements there is no reaction. i researched the "lerp" and maybe i just don't understand it yet.

    Thanks in advance :)

  • anyone?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)