Daiki

Members
  • Content Count

    13
  • Joined

  • Last visited

About Daiki

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ok, Danke. Soll ich dann nochmal einen neuen Treand aufmachen oder hier nochmal auf Englisch schreiben?
  2. Hat keiner eine Idee woran das liegen könnte? oder ist mein Problem was ich habe nicht ganz klar geworden? Wäre super wenn jemand mir dabei helfen könnte.
  3. Die Konsole gibt keine fehler aus genau so wie das Programm womit ich das Script schreibe gibt keine fehler an. Soll ich das Problem nochmal anders beschreiben oder ist es klar geworden?
  4. Moin moin, Wir müssen für das Fach Medieninformatik ein Phaser Spiel programmieren. Ich bin dabei auch schon bisschen weiter gekommen aber jetzt ist ein Problem aufgetaucht. Ich hoffe ihr könnt mir dabei helfen. Es Soll ein Jump and Run Spiel werden mit 15 Levels. Dafür verwende ich einzelne Scenen. Klappt auch für das Menü und so weiter ganz gut. Jetzt wollte ich das Spiel dort in die level1_scene rein fügen aber die Lauf Animation geht leider nicht so wie ich es möchte. Ich weis leider nicht genau wieso diese nicht funktioniert. Sonst Grafiken und so weiter werden geladen. // Level 1 var player; var stars; var bombs; var platforms; var cursors; var score = 0; var gameOver = false; var scoreText; var GameScene = new Phaser.Class({ Extends: Phaser.Scene, initialize: function GameScene () { Phaser.Scene.call(this, { key: 'gamescene' }); }, preload: function () { this.load.image('sky', './img/sky.png'); this.load.image('ground', './img/platform.png'); this.load.image('star', './img/star.png'); this.load.image('bomb', './img/bomb.png'); this.load.spritesheet('play', './img/dude.png', { frameWidth: 32, frameHeight: 48 }); }, create: function () { // A simple background for our game this.add.image(400, 300, 'sky'); // The platforms group contains the ground and the 2 ledges we can jump on platforms = this.physics.add.staticGroup(); // Here we create the ground. // Scale it to fit the width of the game (the original sprite is 400x32 in size) platforms.create(400, 568, 'ground').setScale(2).refreshBody(); // Now let's create some ledges platforms.create(600, 400, 'ground'); platforms.create(50, 250, 'ground'); platforms.create(750, 220, 'ground'); // The player and its settings player = this.physics.add.sprite(100, 450, 'play'); // Player physics properties. Give the little guy a slight bounce. player.setBounce(0.2); player.setCollideWorldBounds(true); // Our player animations, turning, walking left and walking right. this.anims.create({ key: 'left', frames: this.anims.generateFrameNumbers('play', { start: 0, end: 3 }), frameRate: 10, repeat: -1 }); this.anims.create({ key: 'turn', frames: [ { key: 'play', frame: 4 } ], frameRate: 20 }); this.anims.create({ key: 'right', frames: this.anims.generateFrameNumbers('play', { start: 5, end: 8 }), frameRate: 10, repeat: -1 }); // Input Events cursors = this.input.keyboard.createCursorKeys(); // Some stars to collect, 12 in total, evenly spaced 70 pixels apart along the x axis stars = this.physics.add.group({ key: 'star', repeat: 11, setXY: { x: 12, y: 0, stepX: 70 } }); stars.children.iterate(function (child) { // Give each star a slightly different bounce child.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8)); }); bombs = this.physics.add.group(); // The score scoreText = this.add.text(16, 16, 'score: 0', { fontSize: '32px', fill: '#000' }); // Collide the player and the stars with the platforms this.physics.add.collider(player, platforms); this.physics.add.collider(stars, platforms); this.physics.add.collider(bombs, platforms); // Checks to see if the player overlaps with any of the stars, if he does call the collectStar function this.physics.add.overlap(player, stars, collectStar, null, this); this.physics.add.collider(player, bombs, hitBomb, null, this); }, update: function () { if (gameOver) { return; } if (cursors.left.isDown) { player.setVelocityX(-160); player.anims.play('left', true); } else if (cursors.right.isDown) { player.setVelocityX(160); player.anims.play('right', true); } else { player.setVelocityX(0); player.anims.play('turn'); } if (cursors.up.isDown && player.body.touching.down) { player.setVelocityY(-330); } }, collectStar: function (player, star) { star.disableBody(true, true); // Add and update the score score += 10; scoreText.setText('Score: ' + score); if (stars.countActive(true) === 0) { // A new batch of stars to collect stars.children.iterate(function (child) { child.enableBody(true, child.x, 0, true, true); }); var x = (player.x < 400) ? Phaser.Math.Between(400, 800) : Phaser.Math.Between(0, 400); var bomb = bombs.create(x, 16, 'bomb'); bomb.setBounce(1); bomb.setCollideWorldBounds(true); bomb.setVelocity(Phaser.Math.Between(-200, 200), 20); bomb.allowGravity = false; } }, hitBomb: function (player, bomb) { this.physics.pause(); player.setTint(0xff0000); player.anims.play('turn'); gameOver = true; } });
  5. Hello, I have a basic question. I know that it with the question is important what I intend but nevertheless I ask times. What is better or what also brings more features. I had the time viewed what it in the 3D area everything so gint. The biggest ones are tree.js, Babylon.js and WebGL. Is there any better? I have to make an invidual online doorstep to sell houses for example. There I would like to go through as with a computer game as well as the opening of Modal boxen of bootstrap. Thank you very much and greetings Julian
  6. Hello, now I have yet another question. Is there the possibility of several lines or with HTML and PHP to act thereby? Just as it is now that I can only write a certain line, it is unfortunately not for me to use. I need something like bootstrap of modal or Lightbox. Thank you very much and greetings Julian
  7. Thanks for your help and effort. I think I can do something with it.
  8. Hello, if you dedected at babylon objects will use this code. var internalMesh40 = BABYLON.SceneLoader.ImportMesh("", "http://xxx/", "untitled.obj", scene, function (newMeshes, particleSystems) { // Set the target of the camera to the first imported mesh internalMesh40 = newMeshes[0]; internalMesh40.position = new BABYLON.Vector3(91.3,3.5,98.5); internalMesh40.isPickable = true; internalMesh40.actionManager = new BABYLON.ActionManager(scene); //ON MOUSE ENTER internalMesh40.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger, function(ev){ scene.hoverCursor = " url('http://jerome.bousquie.fr/BJS/test/viseur.png') 12 12, auto "; })); //ON MOUSE EXIT internalMesh40.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger, function(ev){ })); }); I want now but not only that the object is dedected but also if you press the E pushes an overlay or Modal opens. Unfortunately I have not been able to find anything yet. Do you have an idea? Sincerely Julian
  9. Hello I think I am too stupid or I have a board in front of the head. Where do I have to go? If I insert that in my script comes nothing more. { "version" : 1, "enableSceneOffline" : true, "enableTexturesOffline" : true } and this one I had so far always only without. manifest var loader = new BABYLON.AssetsManager(scene); var myObj = loader.addMeshTask(name, "", "", filename);
  10. Since I can not load the file so it means for me that the file is broken, as I could load other obj file. The other date do not go into my babylon script.
  11. First time sorry that I am now answer. I had the last days unfortunately no time. I am now answering the piece for piece and then answer correctly
  12. Hello, I did not want to open a new topic. var loader = new BABYLON.AssetsManager(scene); var door = loader.addMeshTask("door", "", "http://www.jp-wolters.de/shop/helloworld/", "door.obj"); BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true; loader.load(); I have this script but the door is not displayed! Can this be that not all .obj files can be loaded into Babylon?