Jump to content

My first babylon.js experiment result [offline]


Artem
 Share

Recommended Posts

Just a few words about my path as programmer. I started with C++ really simple console programs, then I created some very simple platformer using ActionScript 2.0 (you can try it here, keys are: w, a, s, d, spacebar, ~, 1-9 …the most awesome part is that you can draw any shape or even use transparent image and player will react to everything as it should), then I've been playing with C++ (tried some of SDL and SFML), then I stopped. A while ago I wanted to try some more, so I tried three.js and physi.js, cannon.js and now babylon.js. I never tried to program anything in 3D before, of course, and I'm all new to JavaScript and web stuff as well.
 
Now, I'd love to know what do you think about my last experiment (arrow keys to move, space to jump): http://xn--80aagk9abfkmup.xn--p1ai/
 
I also want to thank everyone who answered my noob questions some time ago, but mostly I want to thank gwenael and Wingnut for help:
- Thanks for your time, tips and for being awesome and kind :)
 
I think that's it for now. Any comments are very welcome!
 
P.S. I'm going to continue to work on my thing there for sure (wink)

Link to comment
Share on other sites

It's very nice ! 

 

Badly,  don't understand russian (or what it seems to be russian)... 

 

I'm stucked here : http://i.imgur.com/x4SLJV4.png

 

What am i supposed to do now ?

 

Thank you. Yeah, it's in russian (my first language). I'll translate it into english now (I didn't think about language before posting here for some reason, sorry).

 

Refresh the page, I'm afraid :) Right now there's no goals at moment, just four super-simple events: box touching, box dying, pig fall, pig dying (which is game over that simply refresh the page). Complex stuff will come when I figure out some more things and finish all base stuff I want.

 

UPDATE:

Done. Translated into english language.

Link to comment
Share on other sites

Back online for a day now! Added sounds, animation, fixed bugs, changed movement, fixed falling. It's just a start and getting ready for some much bigger things, I hope :)

 

"I think I like babylon.js more and more every day, oink!"

Link to comment
Share on other sites

There seems to be a problem bouncing when you hit the box. The pig bouncing back and shifts the axis 'Z'

There is also a problem loading the scene when the pig appears, it goes outside of the scene and returns next to the box.

 

I teste with Google Chrome

Link to comment
Share on other sites

There seems to be a problem bouncing when you hit the box. The pig bouncing back and shifts the axis 'Z'

There is also a problem loading the scene when the pig appears, it goes outside of the scene and returns next to the box.

 

I teste with Google Chrome

Thank you for checking it out and testing, dad72. I'll take a look into these errors.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Edit: Server is offline now. See you soon!

Link to comment
Share on other sites

Hi Artem.  I don't have an answer about the dispose() problem... but when I play your game, my cursor keys are very powerful, and if I press any cursor key real quick, the pig shoots off-screen about 1000 miles.  Sound works fine, spacebar works fine, game is real pretty, but my cursor keys are VERY powerful and it makes the game unplayable.  I do not know why... and I do not know if others have this problem.

 

About mesh.dispose()...  after you do the mesh.dispose(), try alert(scene.getMeshByName(meshname)); ...to make sure the dispose() function worked.  *shrug*  Just an idea.  Be good.

 

PS: I see you play guitars and synth!  COOL!  I am also a guitar player, bass player, and play some synth/keys.  I have two Casio WK-1350, and one I use as a midi controller for my Alesis s4 rack synth.  Good fun.  Guitars - 38 yrs, lots of gigs (over 2000)... mostly classic country and/or country rock.  Synth... 2 gigs, I am bad at it.  Also play some fiddle/mandolin.  Lets jam!  (I am 56 years old - geezer)  :)

Link to comment
Share on other sites

Hi Artem.  I don't have an answer about the dispose() problem... but when I play your game, my cursor keys are very powerful, and if I press any cursor key real quick, the pig shoots off-screen about 1000 miles.  Sound works fine, spacebar works fine, game is real pretty, but my cursor keys are VERY powerful and it makes the game unplayable.  I do not know why... and I do not know if others have this problem.

 

About mesh.dispose()...  after you do the mesh.dispose(), try alert(scene.getMeshByName(meshname)); ...to make sure the dispose() function worked.  *shrug*  Just an idea.  Be good.

Thank you for taking a look and testing my thing, Wingnut :)

Hm, wow… I just noticed that if you open context menu (right mouse click) everything goes insane, fps lag appears and key inputs act freaky. Happens everywhere, official babylon.js demos as well (tried physics demo).

Edit: Google Chrome is okay, but IE react really freaky at right-click menu, dunno why… Firefox acts strange as well if you click at window bar. As far as I can see from my log, you're on Firefox under Ubuntu, but I don't really know why it happens yet. Dang, it was a good idea to let people on forums test it :) Strange things I don't have happens with others :D

Edit 2: Right mouse click lag happens everywhere, not just babylon.js, but at any javascript apps.

Link to comment
Share on other sites

Hi again, Artem!  No Ubunto's around here.  Windows 7, Firefox 21, Walmart cheapy computer  -  2.2ghz, 4g ram, Intel Celeron - old people-grade machine.  :)

Ah, that wasn't you then! You've logged in a bit earlier :) Well, that's even more strange now then! I think I'll leave it all to tomorrow's Artem, today's Artem experiencing a headache after eight hours of understanding and coding stuff... I wish someone just tell me what's wrong there now, just because I can't handle it anymore now %) So many things to learn, so little time :(

Link to comment
Share on other sites

Everything works fine for me. but it is true that the movement of pig is very fast.

And if I use the arrow of keyboard to go down, I have a white page.

 

I think you have a problem in your css at <html> or <body>.

try adding position: fixed; this may solve the problem.

 


html

{

    width:99.9%;

    height:100%;

    padding:0px;

    margin:0px;

}


body {

    padding:0px;

    margin:0px;

    width:100%;

    height:100%;

    position: fixed;

    overflow-x:hidden;

}

canvas

{

 ....

}

Link to comment
Share on other sites

Everything works fine for me. but it is true that the movement of pig is very fast.

And if I use the arrow of keyboard to go down, I have a white page.

 

I think you have a problem in your css at <html> or <body>.

try adding position: fixed; this may solve the problem.

 

html

{

    width:99.9%;

    height:100%;

    padding:0px;

    margin:0px;

}

body {

    padding:0px;

    margin:0px;

    width:100%;

    height:100%;

    position: fixed;

    overflow-x:hidden;

}

canvas

{

 ....

}

Thank you for another test, dad72, I'll try to fix it (overflow is hidden already and position is absolute for a reason, but I'll see what I can do, thx).

These things are really strange, since I test different browsers and two PCs (yet both of them are Windows 8.1 x64).

Link to comment
Share on other sites

Works great for me.  Are multiplying your movement speed by: scene.getAnimationRatio();

That might fix some of the quick movement so people are seeing.

Nice to hear that!

Nope. Thank you for the tip, Xanmia :)

Edit: I tried it, played with it and it was about to be okay, but needed to divide it 60 (just like fps, hm). What exactly does this function? I barely understand 'animation ratio' phrase, to be honest :\

Link to comment
Share on other sites

It looks like the problem is finally solved. Any more turbo effects out there, anyone?

Edit: I'm becoming insane. It just re-appeared again. I'm losing it.

Site is offline for now. Thanks a lot for testing it, everyone, I really appreciate it ♥

See you next time :)

Link to comment
Share on other sites

  • 2 weeks later...

The "game" is back online (for 24 hrs or so). Fixed some bugs, also player shouldn't get inside of box or floor for a few milliseconds anymore (finally). Added some particles and some more tiny things.

 

I'm planning first multiplayer test for the next version, that should be fun! :)

 

P.S. it's all 'work in progress' thing, it's not a real game (yet), so there's no 'real goals' and score means nothing, but there are some events, pretty everything is just for tests and some basement for upcoming real game features and etc.

Link to comment
Share on other sites

I have the impression that your page is 200%. 100% for the canvas and 100% additional below.

Surely you have a problem when your scene is load and which would modify the css of your page on the "height"

 

Hm, it's the second time you tell me about it. I also figured out I forgot to remove some 'div' I wanted before public build, maybe that caused the problem you're talking about. But I always check it everywhere (different browsers and android tablet) before showing to someone else and it's fullscreen everywhere, without scroll things and etc., so I have no idea what's happening there.

 

Here's CSS I have:

        <style>            html, body, div, canvas {                margin: 0;                overflow: hidden;                height: 100%;                width: 100%;            }            div.gameClass {                float: left;                position: relative;                overflow: hidden;            }            div.guiClass {                position: absolute;            }        </style>

Anyone else have this problem as well? :\

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...