How do I make a D'pad

Discussion and feedback on Construct 2

Post » Tue Nov 12, 2013 11:57 am

Hello everyone, I have a project in mind which requires a d'pad. It's a zombie apocalypse game where you have to kill as many zombies as possible. It will be for a touchscreen device. Thanks in advance!
B
16
S
6
G
2
Posts: 42
Reputation: 2,554

Post » Tue Nov 12, 2013 12:13 pm

What d'pad you would like use?

By the way, you can use the object "Gamepad", and configure it inside events.

Also, you can add "Or" for each key event and implement your Touch behavior too.
Image
B
104
S
23
G
17
Posts: 1,350
Reputation: 22,028

Post » Tue Nov 12, 2013 12:24 pm

I'm sorry, it's actually called a touch joystick. My bad :3
B
16
S
6
G
2
Posts: 42
Reputation: 2,554

Post » Tue Nov 12, 2013 6:17 pm

I wanted to do the same thing for my project. Here's a capx (without the animations) that shows how I did mine: https://dl.dropboxusercontent.com/u/38658788/touchdpad.capx

Hope it helps.
B
18
S
6
G
2
Posts: 57
Reputation: 2,479

Post » Tue Nov 12, 2013 7:05 pm

DPADS on a touch screen are EASY.

Create 1 sprite with an arrow image.
Create a var in the sprite called DIRECTION
Have for ButtonArrow sprites with direction names for each.

Then
IsTouching ButtonArrow
Function.Call(ButtonArrow.direction)

Then do whatever game logic you want in the function. you can also do without the function. but doing it in the function allows for better future protability of the buttons and easier to integrate with keyboards and gamepads.

Now if you need Analog directional input and not a DPAD. then I have a tutorial in the mobile section that covers the needs. It needs a small update, but the CAPX provided is up to date and shows how to cover pretty much handling all the C2 Touch hurdles.jayderyu2013-11-12 19:06:41
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Wed Nov 13, 2013 3:21 am

@jayderyu, may I know whats the link to the tutorial. Thanks!
B
16
S
6
G
2
Posts: 42
Reputation: 2,554

Post » Wed Nov 13, 2013 3:22 am

@funkyos, thanks!
B
16
S
6
G
2
Posts: 42
Reputation: 2,554

Post » Wed Nov 13, 2013 3:35 am

@jayderyu, how do I implement the controls to move the player?
B
16
S
6
G
2
Posts: 42
Reputation: 2,554


Return to Construct 2 General

Who is online

Users browsing this forum: Ryan Kocourek and 9 guests