don't click here

[Live Demo available!] Motorbug Engine - HTML5-based sonic fan engine! (WIP)

Nascar01

Green Hill Zone
Feb 16, 2021
186
11
43
22
ok thanks , the jump works for me now, I like the music, there are still some bugs but its ok otherwise.
 
Last edited:

Pink_bot

Press Start Screen
Dec 28, 2021
9
2
8
39
Neat engine! I’ve been experimenting with it today and I know I asked you this on GitHub but I’m case you’re not active over there, I was wondering what the variable goingLeft (in index.js) is used for. All I could figure out is that it’s true when the player character is going right and false when it’s going left.

what I’m trying to do right now is decouple the direction sonic is facing from the ground velocity so he can slide backwards on slopes but I wanted to make sure I didn’t create redundant variables or break something important

edit: I’m not sure but this post might belong in the support forum
 
Last edited:

Coderman64

Sound Test
Oct 2, 2019
49
47
28
coderman64.github.io
Neat engine! I’ve been experimenting with it today and I know I asked you this on GitHub but I’m case you’re not active over there, I was wondering what the variable goingLeft (in index.js) is used for. All I could figure out is that it’s true when the player character is going right and false when it’s going left.

what I’m trying to do right now is decouple the direction sonic is facing from the ground velocity so he can slide backward on slopes but I wanted to make sure I didn’t create redundant variables or break something important

edit: I’m not sure but this post might belong in the support forum
IIRC, it is a simple placeholder variable to determine the direction you are facing for animations. The actual direction of your character is actually usually defined by your velocity. You'll notice that when you stop, your velocity doesn't go all the way to zero, but to some very small nonzero number (like 0.001). It uses the sign of this number to determine direction. This is then used to set goingLeft every frame, so I didn't have to type out something like "gVel < 0?False:True" every time.

It might be difficult to decouple direction from velocity, due to this. In some places, it checks the velocity directly, and others use goingLeft. I started the code a long time ago without any real plan, and this is one of the side effects.
 

Coderman64

Sound Test
Oct 2, 2019
49
47
28
coderman64.github.io
Hey all! I added some documentation to Motobug Engine and Motobug Studio in the "Wiki" tab. It's not complete yet, but it's a start!

I've also started adding to-do items as issues in GitHub's issue tracker, so if you want to help out, and see one you can do, drop a comment on it and let me know!
 
  • Like
Reactions: Pink_bot