zikdot's Forum Posts

  • procrastinator I seem to be having some minor complications with my spawning. I posted it as a separate question.

    If you have a chance to look at it that would be GREAT! heres the link

  • I'm making a game that involves 4 enemies. When spawning, one of the enemies will be chosen at random using an array.

    The way i did this was by creating a sprite and within the sprite add 4 seperate animations(being the 4 enemies)

    Then i coded the array as follows.....

    On start of layout > Array > Enemies > Push Back "names of enemies" on X axis

    and for spawning it and selecting the enemy i used the following

    System > every random (1,2) > Create enemy > layer 1 at x , y

    > Enemy > Set animation to > (Enemy.At( floor(random(Enemy.Width)) )

    Now the problem is that when the enemy is created it should select one of the 4 enemies from the animation at random, which it does. However the enemy that is the default animation (the first animation/Main Sprite) is spawned much more frequently than the others??

  • Okay thank you

  • brilliant thanks. Yeah i'm quite the newbie at this haha. Thanks so much. I'll let you know how it goes

  • Haha yeah having looked at that link it does look like a very similar concept.

    How do you pin the sprites together though?

  • so it has the possibility of being in 4 different positions when rotated 90 degrees

  • and if i want the sprite to rotate so that the yellow face was where the red face was for example how would i do that. since it need to rotate but also change its position, and then when rotated change its position again

  • can i create a square which will be used as a sprite where by each of the 4 faces of the square will act differently.

    What I mean by this is that if an object hits the one specific face it will destroy the object but if it hits the other 3 faces it wont?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for your help guys!

  • I tried that and it didn't work. Luckily i accidentally figured it out haha. The brackets were in the wrong place

    Instead of putting.....

    RunTrack.X-(dt*200*(RunTrack.Speed+TrackSpeed))

    it was.....

    RunTrack.X-(dt*(200*RunTrack.Speed+TrackSpeed))

  • I figured it out. You were right it needed to be RunTrack.X-(dt*(200*RunTrack.Speed+TrackSpeed))

  • Wasn't uploading properly so i hope this helps

  • I tried that initially. it just makes the track move really really fast. I think because its being x(multiplied) as opposed to +(added) due to the 200* part of the coding

  • Hey I placed this in a previous post but didn't manage to get any replies. So sorry in advance for asking again......

    I have a run track which is a scrolling background. The coding for the movement of my track is: RunTrack.X-(dt*200*RunTrack.Speed)

    I want it to gradually increase in speed so i created a global variable called 'TrackSpeed', and every 2 seconds 5 is added to the variable.

    Where in the RunTrack.X-(dt*200*RunTrack.Speed) equation do i integrate the global variable?

  • I have a run track which is a scrolling background. The coding for the movement of my track is: RunTrack.X-(dt*200*RunTrack.Speed)

    I want it to gradually increase in speed so i created a global variable called 'TrackSpeed', and every 2 seconds 5 is added to the variable.

    Where in the RunTrack.X-(dt*200*RunTrack.Speed) equation do i integrate the global variable?