JR 01's Weekly Coding Challenge

Are you O.K?

:+1:

Tank movement (Ignore the animations)



It’s kind of hard, since the tank hard to move forwards, backwards, turn, and the gun had to turn.
This is very hard to use with a controller, lol.

1 Like

Nice, I like seeing everyones takes on coding different things like the controller thumbsticks.
When I post my answer/reply to the challenge, I’m going to be sharing some bundles and tricks for the thumbsticks.

2 Likes

Better late than never, here are some expressions for using on controller thumbsticks.

Answer

Calculate the Stick Force with X and Y:
Math.max(Math.abs(A),Math.abs(B))

Calculate the Angle of Stick X and Y:
(((90-(Math.atan2(A,B)/Math.PI)*180)%360)+360)%360

I also ended up updating some of the controller code in my controller example,
so here is a nice way move the player in a top down game.

image

4 Likes

Update:

Before explaining the challenge, I just want to say I’m slowing down on these challenges. I’m still going to be doing multiple challenges each month, but it will not be on a weekly schedule anymore. It was a good month and a half but I’m getting busy with more projects and well frankly I’m running out of ideas for challenges. Doing 3 challenges a week made me go through my list of challenges pretty quickly. :sweat_smile:
But also I want to try to get more users to try out the challenges and give more time to solve it.


Unlocking Doors

May 14th, 2024
Difficulty: Beginner
(Rules)

Show a screenshot of code in the player and the door on how you would use collecting keys to open multiple doors in a single level. There can only be 1 of each object type so you must use clones of the same keys and doors and unlock one at a time in any order.

image

6 Likes

I used a somewhat simple version, but can make a better one if needed.

3 Likes

this is a good challenge, i love games with this mechanic

Point in case of a game with this mechanic - Hour of the Rat by Sokpop:

Hour of the Rat Sokpop

https://sokpop.itch.io/the-hour-of-the-rat

3 Likes

Dawg. How can the animation be that smooth?

I suppose I win? I was the only submission and it’s been a week :rofl:

Heh forgot about this, been busy with finals all week, I’ll get this in later today

4 Likes