dMZX Forums: How would I go about implementing twin stick shooter controls? - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How would I go about implementing twin stick shooter controls?

#1 User is offline   darkhog 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 40
  • Joined: 20-November 12
  • Gender:Male

Posted 10 June 2020 - 01:55 PM

Think Binding of Isaac controls: WSAD for movement, arrows for shooting in the direction the arrow is pointing (e.g. right arrow to shoot right).
There are no impossible things, there is only lack of skills.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
~-+=SMZXDraw! The ultimate tool for editing charsets and palettes for SMZX games - FEEDBACK NEEDED!!!=+-~
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Society consists mostly of jerks. We cannot neglect their involvement into building our civilization - without them we
wouldn't have such wonderful inventions like war, money, drugs... or Microsoft Windows.
0

#2 User is offline   GetDizzy 

  • Touch Fuzzy.
  • Group: DigiStaff
  • Posts: 3,567
  • Joined: 22-November 01
  • Gender:Other
  • Location:MA

Posted 12 June 2020 - 02:11 AM

So, if you want an example of this working you can take a look at MZX Deathmatch, a game which has a simple twin stick control that's extended out to basically be mapped by a bunch of joysticks.

But the basic thing here is that you want to use the Key counters, either reading the value of key_code or a specific key number such as key36 for J. The key codes you're looking for are here:
https://www.digitalm...m/keycodes.html

Assuming you're talking about using robots, you'd want a robot player that essentially checks for say, key72 and runs "shoot north", key17 and runs "go north 1" etc.

With sprites it gets more complex but also much more versatile, as you can among other things handle diagonal movement more easily.
- Your Jumpy Neighborhood Admin

<@Tixus> Anyway, I set the year to 1988 for some reason.
<@Tixus> And set the microwave to run for a minute and 28 seconds.
<@Tixus> But it failed to send me back in time, and I was disappointed.
<Insidious> Tixus accidentally microwaved the 80s
<Insidious> that is my takeaway from this
0

#3 User is offline   GetDizzy 

  • Touch Fuzzy.
  • Group: DigiStaff
  • Posts: 3,567
  • Joined: 22-November 01
  • Gender:Other
  • Location:MA

Posted 12 June 2020 - 02:13 AM

You can also just use the joystick counters to read the analog values from the joystick and use that to determine what direction to move in/shoot in.
- Your Jumpy Neighborhood Admin

<@Tixus> Anyway, I set the year to 1988 for some reason.
<@Tixus> And set the microwave to run for a minute and 28 seconds.
<@Tixus> But it failed to send me back in time, and I was disappointed.
<Insidious> Tixus accidentally microwaved the 80s
<Insidious> that is my takeaway from this
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users