nico_pons's Recent Forum Activity

  • cool! this is pretty much exactly what I needed. I wish I could have made it work without adding an extra variable to store other UID but it looks like it works super well so I will stick to this solution for now. Thanks so much

  • Hi friends, I have a system where instances of an object will go towards an objective, and once the objective is destroyed they will go towards the player.

    Right now they will bunch up at some point, and look like they are the same object.

    I'd like to have a line of code to make the instances repel eachother with a lerp to avoid this interaction. gyazo.com/a928673171ef887f3a58962f0d5326ed

  • Since you have all snake parts as separate objects, you need to add them to a container. Then in the "SnakeHead On Created" event all its parts will be picked automatically, and pinned correctly to each other.

    You may need to add "For each SnakeHead" to your event #4

    Hey, so I had a followup question on this. I have an effect I implemented previously where there's a nice chain explosion on the snake. with the containers, every object in the container is destroyed if another object is destroyed. this makes it hard to use my chain explosion. is there a way to modify my container to allow it to let other objects stay in the scene when destroyed?

  • Oh, by looking at alextro's solution I realized something I could do is have the snake start one section ahead of the snakehead, and have the snakehead point to it.

  • Tag system for flexible use & modularity with only 1 object family:

    https://www.dropbox.com/s/xfdap5rv93wusie/snake_body_pin.capx?dl=0

    This looks like exactly what I'd want! I'll try reworking this solution for myself tomorrow morning as it's getting quite late for me!

  • Since you have all snake parts as separate objects, you need to add them to a container. Then in the "SnakeHead On Created" event all its parts will be picked automatically, and pinned correctly to each other.

    You may need to add "For each SnakeHead" to your event #4

    I just tried this and it works quite well! gyazo.com/0a82f56b6096b22f7227e4d4afabe97b

    there seems to be one issue though where the snake head with inverted movement is flipped. I think there's an equation to determine angle of movement which I should probably be using to determine the angle of the snake head instead of just using the behavior's set angle.

  • Not sure what the problem is? Create a second snake and pick it with events, or create completely new objects for a second snake it's up to you.

    Right, I understood this was a possibility but this is sort of what I wanted to avoid. I envision levels with potentially 10+ instances of snakes with different movement and I want to take the opportunity to learn how to avoid remaking it entirely every time.

  • does it work if you take physics out of the equation?

  • I've coded and designed a snake for a shmup game I'm pretty happy with.

    gyazo.com/ea39742e5f67a376be0c974c35c6f0ff

    I know the code is not the cleanest, but I got the movement I wanted and that was my first step

    gyazo.com/af7ce9a7cea3c9eb0a20b061ec5be0b0

    Right now, I cannot just copy paste the sprites of the first snake and roll as that will cause everything to pin to itself twice and mess with the movement.

    I want to create one sheet of code which would let me have independent snakes.

    This way I'd be able to adjust each one's movement independently.

    thanks so much for replies, also happy pride friends!

  • Hi everyone, I'm going through the exercise of programming Conway's Game of life.

    My current issue is that I have syntax that makes a lot of sense to me, and seems like it's correct other than no looping prevention, but nothing actually changes in my instance variables when I run the debug.

    My current goal is to be able to add 1 to an instance variable neighbors for every tile that is alive and adjacent to the original tile being checked.

    My code is as following:

    If the tile that is overlapping (original tile position)+n is alive, then add 1 to Original tile Neighbors.

    do this in all directions. (x+32,x-32,y+32, etc.)

    Right now it's setup to only do this for the first tile, but it seems to be doing nothing.

  • I'm in love with this example. Thank you so so so much for helping me out with this. It's so much more clear now, and it's crazy to see how many fewer lines of code it needed. It's cool to see you even included a randomizer for different frames.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm really sorry to ask this so bluntly, but how would I actually implement this code?

    I"ve been trying for the past hour to just get something resembling and I genuinely feel like I'm just not aware enough of construct syntax to get it going.

    What I currently have is a system where I've tried to replicate the exercise best I can as you described, but everything gets deleted, as opposed to just the objects of a set type.

nico_pons's avatar

nico_pons

Member since 28 Oct, 2018

None one is following nico_pons yet!

Trophy Case

  • 6-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies