Search the Community

Showing results for tags 'noob'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 26 results

  1. Hello, i am again... i have a realy noob question but cant find an answer. Since i playing with this Playground i try to figure out how i can get the position of the car (mesh = carBody ?) Im not successful. Line 42 - 44 scene.registerBeforeRender(function(){ console.log("Poisition", carBody.position); }); The only thing that changes is when i turning the steering wheel. Nothing about the position on the ground... I tought the carBody "merge" all meshes into one and move them around with them. So that the positions property on child meshes a relative to the parent mesh. I dont get it...
  2. Proper way to animate sprites

    I'm wondering what the best way to animate a sprite is. Is there a basic example or tutorial out there somewhere? I have ten images in a spritesheet that are part of an idling animation, and I made a texture for each of the images. I put the textures in an array, and my plan is to just change the texture of my sprite each frame in the gameloop, looping through the array of textures over and over again. Maybe using Sprite.setTexture ??? Is that a good way to go about it? Any links to info or tutorials would be much appreciated. Thanks,
  3. I'm sure there's probably a really simply explanation for this, and I've certainly put in the requisite time researching and experimenting... but I'm having a hard time getting collisions/physics to work properly with heightmaps. Here's the playground: https://www.babylonjs-playground.com/#UV2S4R#1. Basically, the balls fall until a collision, then they slow down, which is working as expected. However, when you uncomment line #25 (`ground.rotation.y = .1;`), it's almost like the mesh rotates, but the physicsImpostor does not. It seems like I recall reading somewhere that you have to use a Quaternion to rotate meshes with impostors, but I can't find that reference for the life of me. Any guidance would be much appreciated!
  4. Referencing a sprite in a group

    I have a player in a group like this: this.players = this.game.add.physicsGroup(); blue_player = this.players.create(0, this.world.height - 490, 'blue_player'); this.players.setAll('body.bounce.y', 0.2); this.players.setAll('body.gravity.y', 1000); this.players.setAll('collideWorldBounds', true); blue_player.animations.add('idle',[0,1,2],2.1,true); this.players.callAll('animations.play', 'animations', 'idle'); And I add a function to my game prototype that is called by my update function: blue_controls: function () { if (blue_keyMap.jump.isDown) { console.log("blue is going up in the world"); this.players.blue_player.body.velocity.y = 2000; } }, And get: TypeError: Cannot read property 'body' of undefined The error is with this line: this.players.blue_player.body.velocity.y = 2000; I have tried just this.blue_player.body.velocity but get blue_player undefined, and others. I've ran out of things to try that I can think of. I know I'm not referencing the object correctly, but I'm currently putting in the milage to learn object Inheritance and prototypes - and using this game I'm making as practice. I'm just a little stuck, help a noob out?
  5. Hi people! Babylonjs is an amazing bit of code and I am extremely grateful for it's very existence. Thank you for creating it and releasing it for free. Now... I am feeling a bit silly for asking this but I seem to have hit a bit of a road block. How do I access objects on the JSON so that I can instruct a camera to move to them smoothly ( to set as the central focus in the camera's rotational sphere ) and look at them while they are moving towards them. If fact, how do I access JSON items full stop? I know the names of the items in my JSON as I created it in blender and loaded it in the babylonjs editor but I can not seem to call them from code at all. I am also able to load it in BabylonJS. It is all there, ready to go but ... I ... CANT .... PLAY .... WITH .... IT ;-( What is the best way to address these items in JS? I can create a new mesh like basic cube and interact with it by following all of the super helpful tutorials and am considering just loading my scene as separate objs but I am thinking this could be a lot of potentially unnecessary extra work. Thank you very much in advance. I want to become a pro at BabylonJS but just need to get over this first hurdle! :-) ----- EDIT: I figured out the above and it was so simple that I feel like a complete dunce! I was tempted to delete this post to save my pride but I think it is worth leaving around for any other noobs to find! If you create a box in JS in babylonjs eg: var movingbox = BABYLON.Mesh.CreateBox("box", 3.0, newScene); You can move the box on the x like this: movingbox.position.x = -5; If your models is part of the Json this works exactly the same way but you must call your model first: staticbox = scene.getMeshByName("staticbox"); ----- While I am in an asking sort of mood: can I call an action created in the action editor from JS? I have managed to do all sorts of other camera related bits from an overlaid html UI I have created. Marc
  6. Why is this not working?

    Why is this code not working? I followed this tutorial: https://doc.babylonjs.com/tutorials/creating_a_basic_scene and I used textmate to write it ( I am on a mac ). When I open it it takes me to a blank web page.
  7. How to start?

    How do I start my first project, I have messed around with the playground and I'm ready to start the full version. Buuuuuut I dont know how to open the full version. I downloaded all the files from github but I just dont know how to open the actual module
  8. Hello I have messed around with the playground and I would like to use the full version, I downloaded the files from github but i do not know how to actually get into the full version and start coding, please help, I have only ever used python and a small bit of CSS
  9. Hi all, first post, and a Pixi.js noob trying to learn the ropes - so please be gentle! First off, I'm a designer by trade (www.digilocker.co.uk - shameless plug) but I have dabbled in coding over the years mainly on a UI Development basis (AS3 Scaleform, Flash, C# Unity). A lot of my work at the moment is casino games, and we've been looking for a modern alternative for putting these together. Previously games would be made strictly in canvas using sprite sheets and keyframed animations for the most part. I've started using Spine for animations, which in turn has led us to Pixi.js as front runner for a renderer (with most mobiles now supporting webgl). Phaser looked attractive, but not sure it would offer the low level access the developers would need to hook into the backend. My role really is to get a prototype together in some form to showcase animations, get the frontend together and roll that onto future games as we learn the possibilities. Previously tried Animate CC but webgl offerings are seriously limited I think there atm, so thought it was time to get my hands dirty! Javascript is also pretty new to me to be honest, so trying to get my head around it at the moment. I've got a very basic game prototype together, using GSAP for transitions (which I'm already accustomed to), but still struggling on how best to split a game down into classes if this is possible? All the script is in one js file currently, and was wondering if it would be possible to take a more OOP approach? (Can tell I'm used to working in editors and attaching scripts to components etc). So for instance, I have a spin button in the game that has 4-5 functions for the state of the button. Would it be possible to split this down into a separate class just for this button, and have them communicate with the main game file? Similar scenario with a few functions I have for preloading webfonts (based on http://www.enea.sk/blog/preloading-web-font-pixi.js.html). Just trying to lay things out the best I can before I end up with a mammoth js file! Know this maybe pretty basic javascript coding to some, but if there are any pointers, or tutorials out there that cover this side of things, it would be very greatly appreciated! Thanks in advance!
  10. Collide don't work (kinda)

    Hi people! As i already discussed in an another topic in this forum, i'm having troubles with the collide function of the standard physic: I've checked with some log and apparently it is never called, even if the bodies on the scene push each other congruently with the collisionGroups and the collideAganist. Any ideas about what i'm missing? Thanks!
  11. Hi there! Newbie to phaser. I seem to have some issues with my code. For some reason, the hitEnemy function never seems to run when my bullets (from weapon group) hit an enemy. Here's the code. I've removed parts that don't matter. I'd love if you could find out what happened and why.. and also how to fix it.
  12. Phaser overlap

    Hey guys! I wanted to create "can you place building here?". Sometimes I get wrong answer. I create net 10x10 createNet(width, height) { this.net.removeChildren(); for(let i = 0; i < height; i++) { for( let j = 0; j < width; j++) { this.net.create(j*16, i*16, 'net'); } } this.net.forEach( o => o.anchor.set(0.5, 0.5)); this.net.setAll('alpha', '0.5'); } I have callback: game.input.addMoveCallback( (o) => this.updateGrid()); where i try to update color updateGrid() { let x = game.input.activePointer.x ; let y = game.input.activePointer.y; x -= (x-8) % 16; y -= (y-8) % 16; if ( x != this.net.x || y != this.net.y ) { this.net.x = x; this.net.y = y; this.net.forEach(o => this.updateColor(o)); } } updateColor(o) { o.frame = game.physics.arcade.overlap(o, this.obstacles ) ? 1 : 0; } http://pastebin.com/2jME8vbg - here is more code, I also attached full project. I feel right x/y or frame is update too late but I don't know how to prevent it. buildingPlacer.zip
  13. Hi there, Let me start off I'm a real noob at programming, one of my friends got me into this to keep me occupied during sleepless nights :P.... so I started out with the Hello World project, edited it a bit to draw a sprite, move it around with the keys, and afterwards I decided I wanted to make him jump. looked for an example using the Arcade physics, edited my code which looks something like this : window.onload = function() { var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update : update , render: render }); function preload () { game.load.image('logo', 'assets/man.jpg'); } var logo; function create () { // var logo; game.stage.backgroundColor = '#2d2d2d'; game.physics.startSystem(Phaser.Physics.ARCADE); logo = game.add.sprite(game.world.centerX, game.world.centerY, 'logo'); logo.anchor.setTo(0.5, 0.5); // gravity mods // set the world (global) gravity game.physics.arcade.gravity.y = 100; game.physics.enable( [ logo ], Phaser.Physics.ARCADE); // i suppose this is to make it bounce against the rendered window its bounds logo.body.collideWorldBounds = true; logo.body.bounce.y = 0.8; } function update () { if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)){ logo.x -= 4; } else if ( game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { logo.x += 4; } if (game.input.keyboard.isDown(Phaser.Keyboard.UP)){ logo.y -= 4; } else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN)){ logo.y += 4; } } function render() { //game.debug.spriteInfo(logo,20,32); } }; as you might have noticed, I commented some lines out to see if it would fix something... whenever I comment the game.physics.startSystem out, the sprite will respond to the keys pressed. when I remove the comment, phaser just draws a blank screen. ive been trying to adapt my code to multiple examples as shown on the phaser.io page, but I can't get it working. a little bit of help ( even with programming syntax !!! ) would be a real neat and wonderful help thank you guys for reading this if you got this far
  14. http://babylonjs-playground.com/#A83GX#0 Hi All, I have been playing with babylonjs for a couple of days now and excited about it. It's one of the few friendly/easier frameworks that I have come across so far. I even managed to import a couple of models into BJS successfully. But I have a problem and need your help. : ) This is the playground link, right now an arcrotatecamera rotates around a mesh. It gives an illusion that the mesh itself is being rotated, but when I move the object away from (0,0,0) it starts to show that the camera is rotating and not the object. Instead of such a camera hack, I would like to rotate the mesh itself from wherever it is, I googled and found a couple of topics in the forum, but the solutions are not as smooth or eased as the camera solution. It will be great if someone can help me on this. Cheers and thanks for your help in advance.
  15. starcraft maps

    Hi, im new to the forums. I recently came across this opensource game, browserquest, and i thought how better to learn how to program a game by playing with its insides. However, I dont know where to begin when it comes to what tools Im going to need to look at the code and such. btw the title is from how i learned to make some pretty cool technical maps on starcraft back in the day by just playing with other peoples maps and learning from that.
  16. tl;dr: 1. After copying a project template, are you supposed to also copy the phaser.js or phaser.min.js from the build folder into your game file? 2. Do you have to make the css and assets folders on your own? 3. when you separate your css, html, and js folder, how do you call them in your html file? 4. What are the bare necessities you need to make a game that you will wrap using CocoonJS for iPhone and Android? Smart Watches? full length: So I just finished the "Getting Started" tutorial on Phaser's website; although I found it useful, I felt that it did not properly address how to start a new entirely from scratch( i.e. GitHub repo). My understanding right now is that you should copy the "Basic" or "Full Screen Mobile" project templates from the resource folder into your text editor and then I'm confused at this point. Are you supposed to also copy the phaser.js or phaser.min.js from the build folder into your game file? What about the css and assets folders? Are you also supposed to make those on your own as well? I just thought it was confusing how the "Getting Started" tutorial had everything in it's own one file (css, html, and js) and I know I want to separate my different file types into their own folders (btw, when you separate your css, html, and js folder, how do you call them in your html file?). I am coming from an Android Studio (using LibGDX) background where new projects automatically have all the folders you need to make an app (assets, MyGDXGame, Manifest, Java, and some other files you'd only touch once), so having to copy/paste/create a new folder (to make your game playable) into your game file is very foreign to me. I'm just trying to get started with a simple ball-maze game for mobile platforms (iPhone, Android, and maybe smart watches). Thanks!
  17. Question/Advice/Issue with pong game (Thank you!)

    Hello all, I'm new here and I am just getting into game development. I created a pong game from scratch (The file and code is attached). The game works and I'm happy with it, except for one little glitch that it has. Sometimes when the ball hits a wall or one of the paddles, it will stick for a moment in time before bouncing away. I know that it has something to do with the way I update the balls location using the variable time. I used this because I followed a quick tutorial for the game loop. Just wondering if someone with more experience could shed some light on this issue and how to get rid of it. Thanks in advance for any help!!! David test.html
  18. How does the renderer work?

    I am using a PIXI.WebGLRenderer and calling its render method on my stage which renders everything that is a child of the stage. Does this method loose efficiency if the stage has children that are off screen? Should I be removing objects that have gone off the screen so the renderer doesnt try to draw them or is the renderer smart enough not to draw that object? I am making a game with a tiled map and I want to know if I should be removing the tiles from the stage when they have scrolled off screen and then add them back when we go back to that part of the map or does it not matter? thank you
  19. Loading Images

    Hi, I'm new to this whole phaser thing, and I looked around for an answer to my question, but here I am. Here is the github project that I am working on. In my main.js file, which I have in the root directory of the project, I load the images as follows: // Load the imagesfunction preload(){ game.load.image('background', 'TagJam18/images/Background.png') game.load.image('platform', 'TagJam18/images/Platform.png') game.load.image('Wall', 'TagJam18/images/Wall.png') // Sprite sizes are inconsistent so there is no way to do these with constants // The only real way is to resize the window sprite. // I definiitely do not feel like doing that. game.load.spritesheet('dog', 'images/DogSprite.png', 16, 8) game.load.spritesheet('window', 'images/WindowSprite.png', 16, 16)}Then in my create function I try to load my image. // Create the scenefunction create(){ // Physics is a perfectly fine way to do things for this. // The ARCADE engine has all the physics we need for a simple platformer game.physics.StartSystem(Phaser.Physics.ARCADE) // Add in the background. game.add.sprite(ORIGIN, ORIGIN, 'background')However, when I try to run my game, what I get is a black screen. Am I doing something wrong with my folder directories? I have all of my images in an image folder inside of the TagJam18 folder. I'm not very confident that I am referencing them correctly.
  20. Moving a sprite in 2.0 and 2.01

    I'm currently starting with phaser, so this might not be the best way to move a sprite. But it was working for me on 2.0 and now it doesn't so I'm not sure if I am doing things the wrong way or if it's a bug. Given the following code: http://pastebin.com/2N4iAmTd I get 2 different behaviours depending on using 2.0 or 2.0.1 this.bird.body.xworks for 2.0 and moves the sprite apropiately. This doesn't seem to work on 2.0.1 as the value changes but it is not updated on redraw this.bird.x does not work for 2.0 (I'm not even sure it's valid) but in 2.0.1. is valid, but instead of moving the sprite to the new X position it just adds some x-velocity to it and keeps moving it. So, what am I doing wrong? did I just found a bug? Thanks for any tips/solution
  21. Hello, I wrote down my first code with Phaser. but whe I tried to load an image.. a green squared apper o.o here \/ http://www.terebusca.com.br/yuleong/ and here is my javascript var yulSprite; var game = new Phaser.Game( 800,600, Phaser.AUTO, '', { preload: preload, create: create, update: update } ); function preload(){ game.load.image('yul', 'yul.png'); } function create(){ yulSprite = game.add.sprite(game.world.centerX, 0,'yul'); } function update(){ } what I need to do? o.o it's seams to be right, cause I see a lot of guys with the same code. plz help me
  22. I'm sorry if this is painfully noobish to ask but, I'm new to using Phaser and I'm trying to follow along with the examples on the example page. Specifically the breakout game. The Basics examples were easy enough to follow, but I find myself very overwhelmed with the code for the breakout game. I'm trying to follow along, but where am I supposed to find the definitions for the Phaser specific language? Like what does body.collideWorldBounds mean? What does physics.enable mean and what parameters does it take? As far as I can tell, the Phaser documentation page (http://docs.phaser.io/) has none of this information. Can anyone point me in the right direction?
  23. Hi guys, I bet this is a really dumb question, but I can't seem to get timers to work. It's in a state based game, and other calls to the game (this) are working perfectly fine. This is the exact error thrown by FireFox. TypeError: this.time.create is not a functionChromium throws: Uncaught TypeError: Object #<Object> has no method 'create' (index):56States.Game.create (index):56d.StateManager.loadComplete phaser.min.js:4d.Game.loadComplete phaser.min.js:5d.SignalBinding.execute phaser.min.js:4d.Signal.dispatch phaser.min.js:4dispatch phaser.min.js:4d.Loader.nextFile phaser.min.js:10d.Loader.fileComplete phaser.min.js:9a.data.onloadHere is my code (if you need to see more let me know) : States.Game = function (game) { ... var timer; };States.Game.prototype = { ... create: function () { ... timer = this.time.create(false); timer.add(500, spawnEnemy, this.context); timer.start(); }, ...}I'm fairly new to JS (I have the most experience with Java, but am not an expert by any means) so there might be some structure issues with the code. Any help would be appreciated.
  24. Collision help

    Hi friends, new to the forum and to Phaser. Basically I'm trying to get my bearings and right now I'm just sorta turning the "Making your first Phaser game" tutorial http://www.photonstorm.com/phaser/tutorial-making-your-first-phaser-game into a more RPG-style dealy. My issue is that my sprite-to-sprite collisions seem to be working well, but if say I walk into a sprite headed right, bump into another sprite and then go a bit up or a bit down, sometimes I can continue through the sprite by heading further right. I don't have this problem with tileset collisions. Here's what I have for movement: //LEFT if (cursors.left.isDown) { if (player.body.touching.left) { player.x += 3; } else { player.body.velocity.x = -100; player.animations.play('left'); }//RIGHT } else if (cursors.right.isDown) { if (player.body.touching.right) { player.x -= 3; } else { player.body.velocity.x = 100; player.animations.play('right'); }//UP } else if (cursors.up.isDown) { if (player.body.touching.up) { player.y += 3; } else { player.body.velocity.y = -100; player.animations.play('stand'); }//DOWN } else if (cursors.down.isDown) { if (player.body.touching.down) { player.y -= 3; } else { player.body.velocity.y = 100; player.animations.play('stand'); } } /*else if (cursors.up.isUp) { player.body.velocity.y = 0; player.animations.stop(); } else if (cursors.down.isUp) { player.body.velocity.y = 0; }*/ else { // Stand still player.animations.stop(); player.frame = 4; player.body.velocity.x = 0; player.body.velocity.y = 0; } }And for collisions: game.physics.collide(player, mans); Is it something I did? Am I doing something really inelegant and unnecessary or something? Should I add something with overlaps? Thanks in advance.
  25. How friendly Phaser is ?

    Hello everyone, 3 months earlier i wanted to start learning HTML5 game development and somehow i found myself turned into unity3D and to be honest i don't regret that at all, i've been involved in the game development field for almost 4 years now and i never finished a single game which is something that i proudly did with unity3D, and i guess the reason of that was 1st my knowledge of the C# language, the tools available inside the unity engine and the super helpful unity community. because of these reasons i wasn't able to only finish my first game, but i actually had 4 offers to work as a freelancer for mobile game development and for the first time in my life, i have made some decent incomes from game development. Now the question is, as someone with Java background, a unity3D developer with C# and NEVER made a HTML5 game, how helpful Phaser would be for me ? and why should i choose it instead of one of the many available html5 engines and framework out there ? PS : currently am reading the Phaser's getting started documentation and later i will give this tutorial a try : Making your first Phaser game so maybe i could answer the previous question myself, but i thought this is a topic that can be useful for anyone later, so, thank you for your help have a nice day