Help getting rectangle block to follow round square corner

0 favourites
  • 7 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm making a Square pong game and require help in getting the paddle to navigate around the square corners correctly.

    I'm looking for the paddle to follow round the corner rather than how it is now, where the paddle just changes angle when it gets to the corner.

    I've provided an image to show what i'm after. The white block is the paddle, as you can see, it wraps around the corner which is how i want it.

    I've tried doing it with the paddle being made up of 4 square sprites and when it gets to a corner, it moves round it one square at a time. It kind of works but i'm look for more precsion where the amount of block going around the corner is dependant of how far you go around the corner (Hope that made sense )

    I've provided a capx (Thanks to SimoneT for help with the capx), I'd appriciate any help on this.

    https://www.dropbox.com/s/tmxurc76dctnw50/SqPong.capx?dl=0

    Thanks

  • Just a thought. (Can't see image) could you have a sprite in the middle of the layout, then every tick set the player controlled block angle to face the middle tile? . More or less utilising a circle pong game

    You could have 4 seperate blocks, and apon hitting a corner tile, switch control and visibility of the block, trouble is that may give you trouble(have to move down and up to hit the block again)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aher0

    Sorry about the image, i've reuploaded it now, so you should be able to see it.

    The circle pong game uses a pivot mechanism to rotate the paddle around the circle similar to what you've mentioned. In that case though, the paddle doesn't need to change shapes to go around corners or anything like that, so i'm not sure if that could work for me.

  • Ooh, i see. Potentially pin sprites rope style?

    Ooor, just a thought , dont use a paddle, have loads of squares around the edge of the map. Using the controls change which Is visible and solid.

    A bit of a long shot, and some variables needed, but I think visually this would flow quite nicely?

    Like on key is down, every x seconds (allowing upgrades potentially for speed) add 1 to GV.

    Every tick

    pick block where block.var =GV.

    Block var=gv-1

    Block var =gv+1

  • Aher0

    Sorry about the late reply, only just logged in and check the message.

    Thanks for the suggestion, i did try rope pin sprites but i didn't have much luck with it.

    For the second suggestion, I get the concept where you have squares around the area and on touch, the squares become visible. How do i decide the amount of blocks visible on touch, to determine the length of the block?

    I'll give your suggestion a go and get back how i get on. In the meantime, would you be able to use my capx file to give it a go yourself if possible please? I must admit i'm a little confused by the method, but thats most likely down to me rather than your explanation

  • Here's one idea on how to bend the box around the corners.

    https://dl.dropboxusercontent.com/u/542 ... snake.capx

    There's probably a lot of simplification to be had.

  • R0J0hound

    Thanks, looks promising I'll take a look and try to get this into my game.

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