Help getting rectangle block to follow round square corner

Get help using Construct 2

Post » Fri Sep 16, 2016 6:14 pm

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.

Image

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
Last edited by rayray on Sat Sep 17, 2016 3:23 pm, edited 1 time in total.
Image ImageImage
B
7
S
2
G
1
Posts: 95
Reputation: 1,249

Post » Sat Sep 17, 2016 12:01 am

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)
B
9
S
3
Posts: 113
Reputation: 1,009

Post » Sat Sep 17, 2016 3:34 pm

@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.
Image ImageImage
B
7
S
2
G
1
Posts: 95
Reputation: 1,249

Post » Sat Sep 17, 2016 5:16 pm

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
B
9
S
3
Posts: 113
Reputation: 1,009

Post » Tue Sep 27, 2016 3:12 pm

@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 :)
Image ImageImage
B
7
S
2
G
1
Posts: 95
Reputation: 1,249

Post » Tue Sep 27, 2016 8:53 pm

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.
B
94
S
33
G
118
Posts: 5,394
Reputation: 75,849

Post » Mon Oct 03, 2016 4:44 pm

@R0J0hound

Thanks, looks promising :) I'll take a look and try to get this into my game.
Image ImageImage
B
7
S
2
G
1
Posts: 95
Reputation: 1,249


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests