Pandy's Recent Forum Activity

  • zenox98

    Thanks , i have come across your tutorial before and used similar techniques to save the positions of the snake. But i'm trying to make a snake artificial intelligence rather than a user controlled one. Thanks anyways.

  • Lordshiva1948

    That demo is just a button that directs you to the newyorktimes website when clicked. I'm not sure if your trolling or uploaded the wrong capx

  • Lordshiva1948

    Thanks , but i can't open it as i've got r168 stable . is there a way to open it in older versions of C2?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey guys,

    Iv'e been trying to make a snake ai with C2. I saw that gif where the snake ate all the food and ended up filling the whole screen with itself and thought of replicating it.

    I'm having trouble trying to make the snake avoid running into it's own tail.

    I can avoid this if the snake is directly facing a tail segment with the help of line of sight behavior but not when the snake is right next to its own tail not facing it's tail segment.

    I have conditions where 'if food.X greater than snake.X => move right' and so on for all directions for the snake to move automatically. The tail is a square segment which is spawned when 1 food is eaten

    (Take example where the snake is moving up/down and has to move right to get it's food)

    The problem is avoiding the snake from moving right if it has a part of it's tail to it's immediate right, and only move if it's clear.

    If i put a condition 'check if tail is snake.X+10' , the system checks for all the tail parts and even if one tail part is not snake.X+10 the condition lets the snake move even if another tail is snake.X+10.

    Using picked instances makes the snake not move at all for some reason, i think it's cause if no tail meets the picked condition the condition to make the snake move is not met.

    Can anyone help?

    Thanks

  • matthewhxq

    That error usually pops up when previewing over lan. It wouldn't occur on the compiled version of your project. I think.

    Can anyone confirm.

  • In the multiplayer tutorial examples, the peer and host are basically interacting and seeing the same things as the other player is seeing.

    I want to know if we can make a multiplayer game where maybe the host can see some things which the peer can't and vice versa.

    For example take a game where player1 has to run across the screen and avoid mines planted on the ground.Now we want player 2 to be the one planting mines and he can do this by clicking on the screen and a crosshair as an aiming aid.

    Now we want player1 to only see the main character sprite and player 2 to be able to see the main character sprite and the crosshair.

    Basically want i'm asking is are we restricted to host and peer seeing the same thing or can they have different perspectives on what's going on during gameplay.

  • I mean, say there is a game and P1 is the host and P2 becomes the peer. They play the game and then say for round 2, can we make P2 the host and P1 the peer?.

    Imagine a dodgeball game where P1 controls the player and P2 taps on screen somewhere to spawn a ball at that point and for round2 P2 becomes the player and P1 controls the ball. I was thinking about the lag that may occur and cause an unfair advantage to the host due to the inaccuracy in position that may occur when P2 controls the player.

    Is it possible?

  • BluePhaze

    What about cocoonjs compiled apks?. Can it work on android devices.

  • Is there a plugin or anything that makes it possible?.

  • That's weird. Does it only occur on mobile? or does the penguin pass right through in desktop as well? Does it happen for the popsicles too?. You exporting using cocoonjs?.

    It seems fine when i tested on my android.

    You sure you didn't change the code, The for each block loop is still present right.

  • Ha sorry but i'll need more time to understand how all those variables play together. You can keep trying new ways and testing. That's the best way to learn.

    If the game works as it is i wouldn't really bother with trying to optimize the event sheets. The performance gains you'll get is really negligible compared to the gains you'll get from removing unnecessary events, objects, collisions etc.

    If you are gonna use cocoonjs, export the project with version 1.4.7 rather than their 2.0.0 beta. Performance is definitely better in the older version.

    If the game works as it should at 60 fps on mobile, publish it and then iron out your event sheet for future updates.

  • Here you go.

    I have completely removed the need for collisions in your game. I added events where you compare positions for the penguins and the block and Popsicle. Added comments so you can get an idea how i did it.

    You seem to have a snow hitbox items which i don't know what it's used for. I left it as it is but it had collisions enabled and it will effect performance.

    You can definitely improve more by yourself. Check the forums, tutorials, destroy objects that are not needed on screen, reduce the particle numbers in your particle object if you can it's a known performance downer

    If you can add a blue outline to the score text, makes it easier to read

    Get back with how much better fps you get

Pandy's avatar

Pandy

Member since 1 Mar, 2014

Twitter
Pandy has 1 followers

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies