jeffige's Forum Posts

  • I'm trying to get an object to spawn at the player's position (got that) and move toward the windows center regardless of the players co-ordinates at the time the object spawns.

    I've tried many variations of bullet - set angle of motion > windowwidth/2, windowheight/2 but C2 won't let me use any of those.

    Thank you for any input on this matter.

  • calebbennetts I can't use container since the parent disk is destroyed with the star. May have to add a few events for each disk/star.

  • calebbennetts nimos100

    Thanks for all the help. At the start i was just planning on the AllPlats and Stars giving a general score, but since decided to try and add combos.

    This is why i think i need to pick the size of the disk.

    And i forgot all about containers. Gonna try and get the logic right for the ComboMultiplier.

    Thank you again for the help. Much appreciated.

  • On 2nd thought, the star does matter. If there was no star then the player would only have to come into contact with the disk to score. With the star the player needs to make it to the center of the disk.

    Besides, people love collecting things.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can get the pinned UID when you use the pin behaviour.

    For instant:

    > On start of layout
          Pin object_1 to object 2
    
    On key pressed 'A'
         text1.text = str(object_1.Pin.pinnedUID)  <-- (Will set Text1.text to the UID of object2, you can use this to pick the correct disc and then get the correct size/score)
    
    [/code:32ofe0x5]
    

    You can see how i the stars and disks overlap.

    There isn't a key press. The game will use tilt for the gameplay and On Tap Object - Play - that will take the user to the main layout. This is how i have the pin event right now:

    I just made 3 more families - LgDisk, MdDisk and SmDisk. So i should be able to change and add 2 more events for - System - For each LgDisk/ MdzDisk/ SmDisk.

    And forgive me nimos100, i'm not understanding your text1.text = str(object_1.Pin.pinnedUID)

    Can i trigger that with - LgDisk > On Created?

    Thank you for the replies.

  • How I would do this depends on how much the star matters. Can you overlap a disc without a star being on it for less points? If each disc always has a star pinned to it then the star doesn't really matter does it and is only a visual thing, it's just the disc that matters and you award points based on the disc type being overlapped.

    Damn it - you just made my brain hurt. I never even thought of it like that. Always the wise one.

  • I have 3 different size disks - small, medium and large. On start of layout a blue star is created for each and every disk, then pinned to that disk. When the player rolls onto a disk and is overlapping a star it adds to score. But since these different sized disks can overlap each other, as if they were on different layers (they are on the same layer) how can i differentiate what star is pinned to what size disk?

    Example - large disk with star is worth 1000 points, medium = 2000, small = 3000.

    If there are 2 large disks, one on top of another, and a small disk underneath those two large disks, and the player rolls onto the top most large disk, he should score 5000 points. Large =1000 + large = 1000 + small = 3000.

    I know i'm going to need a variable, but i can't seem to get this right, since . . . well . . . i don't know what the hell i'm doing.

    Any help is immensely appreciated.

  • Sup with that Thanks for the reply

    No, the layout is static. It's a bit taller than the actual window, this gives the disks time to be created out of view and move in their direction(s). I almost had the expression right, but they were still being created closer towards the ViewportRight than ViewportLeft. After about 6hrs of messing with it, I decided to go back to the original plan.

    They are now created off screen, just above and below the largest viewport, and 32 pixels away from the window on the X axis.

    Tested on 3 different phones and 1 tablet. Although the tablet does have the biggest viewport, the disks are about a ball and a half width away from the edges on the X axis, and on the phones they are only a few pixels away. This i don't mind too much. It looks even and uniform.

    Again, thanks for the reply.

  • On the start of layout - blue circles should be created at random locations within the viewport and move either at 90 or 180.

    The green circles should be created just outside the viewport on the Y axis (top/bottom) and randomly along the viewport on the X axis and move either at 90 or 180 (circles move in direction of arrows).

    I've tried many different ways - viewportleft/right, windowwith, separate, together, X/Y....

    But when i run the layout, some of the randomly created green circles are outside the edge of the viewport along the X axis, as shown in the image below.

    This is the problem i'm having difficulties trying to solve. The green circles should be created within the viewport no matter the width of the phones screen.

    If anyone knows a solution, it would be greatly appreciated. My gamedev has come to a halt trying to solve this major issue.

  • Still stumped on how to create these objects so they are only created just outside the viewport on the Y axis, but within the dimensions of the X axis.

    Example: Layout is 576 X 896, window is 320 X 640. Objects should be created at : X random (45, 275) Y -90

    On scale outer the window shows more of the layout, and the objects are created around 100 pixels inside the edgeof the window.

  • Have you tried: player is on floor (inverted)

    "Condition" left key is down > set player not mirrored.

    Do the same for right except > set mirrored.

  • The main objects in my game are 90 x 90 pixels and have the bullet behavior. They travel at an angle of 90 and 180. Testing my game over lan using letterbox scale everything seemed fine, but with scale outer they are too far away from the edge of the viewport on the X axis.

    I tried following some demo examples but now they are created too far outside the viewport on some phones, tablets.

    How can i make sure they are always created within the viewport width?

    Would it stay constant across different phones?

    Thanks for any input and help.

  • 99Instances2Go

    Holy crack, braniac! Uhhhhh.....thanks for the reply.

    Gonna have to go over that a few times for it to sink in.

  • "The Image"

    Disks are created with stars for each disk. Since the disks are created at different times on that layer, they overlap each other - each new instance is created above the last instance.

    If the ball is 'overlapping' or 'on collision' with a star it's destroyed and scored (I've tried both ways). The problem is if there are other stars directly below the one the ball is currently on, all stars underneath are destroyed and scored.

    How can i destroy and score only the star that is on the disk that the ball is currently on? I've thought about trying it as scoring a 'combo', when 2 or more stars are directly underneath, but that's way beyond my brain.

    I've tried different ways that 99Instances2Go solved for me in the capx of this thread: https://www.scirra.com/forum/viewtopic.php?t=183022 which include a 'pick top instance' sub-event, but still can't figure this one out.

    Thanks for any help or input.

  • A big thank you, brother. Used your method, just cloned the ball > resized to half > pinned. Works perfectly!