Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

2.5D Platformer

edited June 2016 in Code Sharing Posts: 103

Hey everyone!

I decided to challenge myself with some fancy 3D coding, which I haven't really done before, so this is my first big project in 3D! As a further challenge, I wanted to see how much I could program in one go without testing it. I got about the first half of the game setup before I tested it out.

This is a kind of 2.5D Platformer where the graphics are all 3D, but the collisions are handled by Box2D. It's a pretty simple maze game, and probably not very original, but I think with some more work it could become a very fun game! I would love to get some feedback on the game so far, and maybe a few suggestions on where to go from here. Thanks!!!

https://gist.github.com/Dwiniflin/903e3506b1a24fec649d5dae33a8900c

Screenshot!

EDIT: I forgot to mention the first time, I have two levels so far, and you can switch between these by changing level somewhere in setup() to either 1 or 2 (or 3 if you feel like making your own level)

Tagged:

Comments

  • Posts: 103

    I know I posted this under "Code Sharing," but I have a question too:
    In some of the levels there will be short walls that the ball can roll up and over if it is going fast enough, but because it is run by Box2D, the force applied to the ball is dependent on your fps. I've noticed that the ball has no problem if your iPad is running around 60 fps, but if it is running slower, the ball will hardly bounce when it collides. I'm wondering if I should somehow work DeltaTime into the force applied to the ball, or if there is a better way to go about fixing this. I don't think beating the level should depend on how speedy quick your iPad can run.

  • IgnatzIgnatz Mod
    edited June 2016 Posts: 5,396

    It's very nice for a first effort.

    I think you absolutely should use DeltaTime, simply multiply it by your velocity (after making your velocity the speed per second, of course).

    I was interested in the ball colour and rotation, as the effect looks nice, and rotation can be difficult to get right in 3D. Where did you get the idea for that, ie

    rotate(30,1,1,1)
    rotate(player.angle,-0.1,0,0.1)
    
  • Posts: 103

    Thanks @Ignatz! I agree, 3D rotation is kinda weird, and I still don't really get how it works. I was actually trying to create a different effect, but whatever I did looks alright :|

  • IgnatzIgnatz Mod
    Posts: 5,396

    3D rotation is actually incredibly difficult (I'm talking about adjusting the rotation, or spin, when an object collides with something, rather than manual rotation, eg with a joystick, which isn't difficult).

    If it helps, I've included a lot of techniques I found on the net, in an ebook (3D bag of tricks), here

    https://www.dropbox.com/sh/mr2yzp07vffskxt/AACqVnmzpAKOkNDWENPmN4psa

  • edited June 2016 Posts: 103

    @Ignatz I got a chance to test out DeltaTime and it works perfectly! I tried adding a for loop that runs about a million times each frame, dropping the fps down to 5. It still runs the same, minus the extreme lag on everything else...

Sign In or Register to comment.