• Content count

  • Joined

  • Last visited

  • Days Won


samid737 last won the day on April 18

samid737 had the most liked content!

1 Follower

About samid737

  • Rank
    Advanced Member
  • Birthday February 12

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    The Netherlands

Recent Profile Visitors

412 profile views
  1. Goedemorgen! The effect you have made looks pretty much the same as using rendertextures to draw a trail. Maybe this example will give you more ideas/insight: I think you will also have a benefit in performance by doing this (not sure though, you will have to compare).
  2. The color space that you use and coordinate system used in your interpolation function affects your interpolation result. There is not one unique way to linearly interpolate to your desired color, but there are many options (this answer show what's happening and this one to compare interpolation results). So when you want to go from red to blue, which path do you want to take? This might be the reason why the color interpolation does not look right. (try going from red to green in RGB vs in HSV). Some suggestions/ideas: -Maybe you can try to use a different color space to get better results. Here is an example of interpolating colors in HSV instead of RGB (the source code from here): -Try changing your colors in intermediate steps, so RED--->GREEN becomes RED---> YELLOW---> GREEN. -Try shifting the hue of your sprites using a custom shader (needs WEBGL). Example: This will require a custom function that multiplies the cosine and sine in the shader by some fixed increment(angle) everytime you reach some new score. This might also not be the ideal solution for you, but maybe you can hack something out of it (its what I do most of the time).
  3. Yes in your case you have two different game objects in one group, each having a seperate body to replicate the example. However, using P2 would be futile since it does not fix your problem (see above). Scaling the images directly is the way out then.
  4. EDIT: Cancel that, the same issue exists (hickups) when making the bodies heavy. Thats strange I did not notice that, but I understand your problem now. An alternative (more costly though) in case it is an issue that must be addressed: in P2 physics it sort of looks okay:
  5. Hi here is your code put into an example: In the example the collision works fine? Are you sure you did not miss something out?
  6. @sammenice one I did not know about setting the magnitude.... @mironcaius a little bit of nitpicking, but setMagnitude() boils down to one Math.sqrt function call , so I would pick that one if it produces the exact same result.
  7. I see your point, I was approaching it kind of differently.. sort of like kicking the ball from larger distance would give you a higher kick strength (more like a free kick/penalty).. But your solution would be the right way now that I think of it (if your BALL_SPEED is a function of the distance , that is).
  8. Hi, if you are using physics (arcade or P2), then the syntax for adding velocity to a body is: ball.body.velocity.x+=-difference.x; ball.body.velocity.y+=-difference.y; Here is an extra example in case you might be stuck (including drag to slow down ball):
  9. You could re-align the canvas via scalemanager to align vertically and horizontally if that helps. You can respecify the size of your map by adjusting the tilemap itself (the source).
  10. Can you explain your problem a bit more? It is not very clear yet to me, maybe an example game that has the same you want?
  11. try adding the third or/and fourth argument for makeParticles. Here is an example as an extra reference:
  12. In arcade physics, your bounding boxes will always remain axis aligned (its how the collision detection algorithm works). Here are two ideas: 1. switch to p2 physics. This shouldn't be too much work in your case. 2. Since you are using beams which are similar to lines, you could use geometric lines instead of sprites and draw the lines using graphics to replicate your beams.You could then check for intersections between lines and rectangles (this post has a good codepen example). I think you should even be able to add the gradient to your line via linestyles, but im not sure. If its not possible, you could cut your beam sprite to the point where it is completely filled and add it on top of the line, but below the player sprite.
  13. Nice solution! I never worked with polygon masks, so definitely good to know for future purposes..
  14. If the game objects are litterally just like the example picture, maybe you can use different blend modes (requires Web-GL) for your shapes, but it becomes less nice if you use textures instead of simple shapes. An example:
  15. EDIT: I misread the topic, I thought @Befive.Info was asking the question and replied to add his source code... Il just leave it in case someone ever needs it. NEW ANSWER: Here is another way to do it using A nested for loop (might not be as efficient, though, but it works):; for(var i=0;i<13;i++){ for(var s=0;s<13;s++){ var object=makeBoxes(150,150,s,i); } } } function makeBoxes(x,y,s,i){ this.sprite=game.add.sprite(x+s*40,y+i*40,'boxes'); boxGroup.add(this.sprite); return this.sprite; } Applied to an example: OLD ANSWER(ALREADY ANSWERED BY @Befive.Info): You can make a custom sized grid by generalizing block building to a procedure with input arguments. Here is an example of what you could do: It is just A procedural approach to your box building. So you just do the exact same procedure for your other blocks, but you change the row size and keep a count of the row index. You could build the boxes as seperate groups (you have one parentgroup currently) via the procedure, so that you can customize the position of the group to your will. You could also just simply add an if statement that checks the element in the _keyNames: if(isAnumber(_keyNames[key])){ _each_row_has=4; }else{ _each_row_has=8; } function isAnumber(n){ //some function that checks if it is a number } But the indexing will fail in this case (positions relative to letters won't look nice).