Jump to content

JcKairos

Members
  • Content Count

    19
  • Joined

  • Last visited

About JcKairos

  • Rank
    Member

Recent Profile Visitors

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

  1. May I know how to find out whether is it dragging from the left or right?
  2. Is there anyway to detect where is the player dragging? I want to give the player a warning sound once they drag the object to the limit.
  3. for (let i = 1; i < xPoints.length-1; i++){ a= i*2 this.game.add.tween(graphicsend.currentPath.shape._points).to({a: (225-newypoint[i]) }, 500, Phaser.Easing.Linear.None, true); } for (let i = 1; i < yPoints.length-1; i++){ b= i*2 +1 this.game.add.tween(graphicsend.currentPath.shape._points).to({b: (315-newxpoint[i]) }, 500, Phaser.Easing.Linear.None, true); } Hi, I am trying to tween the points of a graphic but I am having trouble looping it. The a and b variable I set is useless but if I set it to for (let i = 1; i < xPoints.length-1; i++){ a= i*2 thi
  4. I need to create a project based on a flash project, however, I can't think of a way to replicate this: I was thinking about using graphics but I do not know how to update it when dragging. Is there anyway to create this?
  5. Is it possible for this kind of shapes? And may I know what does the 4 and 5 represent in this code: game.add.tween(rightG.currentPath.points).to({4: 0, 5:0}, 2500, Phaser.Easing.Linear.None, true);?
  6. I am currently creating a program to teach players about symmetry but I encountered some problem This is what I want to get: The program works fine when flipping horizontally. However when it comes to diagonal: Is it possible for the figure to flip diagonally while it stays on the line of symmetry and not not fly out of it? Flip code of horizontal: this.game.add.tween(graphicsend.scale).to( { x: graphicsend.scale.x*-1}, 500, Phaser.Easing.Linear.None, true); this.game.add.tween(graphicsend).to( { x: 450}, 500, Phaser.Easing.Linear.None, true);
  7. graphicsend = this.game.add.graphics(0, 0); graphicsend.beginFill(0xffffff); graphicsend.lineStyle(3, 0x228B22, 1); graphicsend.moveTo(startpoint.x,startpoint.y); i =1 while (i < numberoflinesdrawn+1){ graphicsend.lineTo(storedx,storedy) i++; } graphicsend.endFill(); This is my code for creating the graphic which the player have drawn, but due to the first line of this.game.add.graphics(0, 0), all axis related to the graphic became (0,0). So I do not understand how to add child since everything wil
  8. Hi, I am trying to create generate a texture for my graphic so I can use it as a sprite. However I have a problem when using the following code: sprite = game.add.sprite(400, 300, graphics.generateTexture()); as the graphic which I want to create is done by the player, so I have no idea how to set the x axis and y axis so that the generated sprite literally takes over the place of the graphic. Is there a way to add the sprite right above the graphic?
  9. Currently I am trying to get a graphic figure to flip diagonally, it is working fine when flipping horizontally and vertically using the codes: this.game.add.tween(graphicsend.scale).to( { y: graphicsend.scale.y*-1}, 500, Phaser.Easing.Linear.None, true); this.game.add.tween(graphicsend).to( { y: 630}, 500, Phaser.Easing.Linear.None, true); and this.game.add.tween(graphicsend.scale).to( { x: graphicsend.scale.x*-1}, 500, Phaser.Easing.Linear.None, true); this.game.add.tween(graphicsend).to( { x: 450}, 500, Phaser.Easing.Linear.None, true); However, I faced a problem whe
  10. May I have the source? Don't really understand this code. (Sorry for the late reply, was on vacation)
  11. Is there a way for it be visually flipping and not seem like it is becoming small and then large again?
  12. I know that tween flipping horizontally and vertical can be done with sprite.scale.x*-1 and sprite.scale.y*-1. I can get the result of diagonally flipping by implementing both the horizontal and vertical flipping, but it does not look like it is flipping when tween and instead just looks like it became small and larger again. Is there any way to show it flipping diagonally?
  13. I am creating a program which shows a graph and the user have to click on a point on the graph which will create a line from (0,0) to the clicked point, the program is working but is there any way to use game.add.graphics to create dotted lines instead of solid lines?
×
×
  • Create New...