mikehive's Forum Posts

  • This is actually very good! Simple and intuitive and extremely playable. With a bit of polish I could see this on the app store no problem! Kid's got talent

  • Ayolabi12345 study the events that Alextro gave you and work out exactly what everything does! I hate using other peoples' code because I always break it if I don't understand how it works. When you've figured out how it works you can work out what you can change without ruining it

  • That's one way to do it! Or you could use mid() to pull out one character at a time to the array by just doing

    2 variables: whatWord, whatIndex (initial value 0)

    array, for each X element: set value to mid(whatWord, whatIndex, 1), add 1 to whatIndex

    Haven't tested but that's what I'd try. Then all you have to do is pull whichever letters out of the array however you want the game logic to work

  • Hi, welcome to Construct 2! These are all easy things you can learn by reading the manual and the tutorials on this site, particularly about global variables! Here is a good beginners guide: https://www.scirra.com/tutorials/37/beg ... t-2/page-1 In particular the section called "Keeping score" will help you!

    Good luck!

  • It's good practice when using platform movement to make the player platform behavior sprite an invisble non-animated simple shape like a rectangle and then put all the animations in a separate sprite object that is pinned or otherwise set to always have the same coordinates as the other. That way the invisible sprite handles all the movement and collisions, and then you don't have to worry about collision polygons on your animations at all.

  • The way I do this is to have a separate sprite object called scrollObject to handle scrolling, and make a variable to control its x-offset (because it sounds like you want it to be not centered on the cat, but done so that the cat is on the side of the screen). Let's call that variable scrollOffset, and give it an initial value of whatever you want. You'll probably have to try a bunch of different amounts of offset to get it to look just right. Let's also make another variable called scrollSpeed so you can easily change how fast the 'camera' moves over to the cat and give it an intitial value, let's try 5 (again you'll want to test it out). Oh, and let's give the scroll object an instance boolean variable called doScroll, so we can tell it when we want it to do the scroll (initial value false). Then in events:

    -on start of layout: set scrollObject X position to catSprite.x+scrollOffset

    • cat collides with platform: set scrollObject.doScroll to true
    • scrollObject.doScroll is true

    ------scrollObject.X < catSprite.X+scrollOffset: set scrollObject X to scrollObject.X + scrollSpeed

    ------else: set doScroll to false

    EDIT whoops I'm too late I guess, also perhaps I misunderstood what you wanted

  • Could you sum up that stuff in one line that just sets the health sprite animation frame to HP - 1?

  • Hey, so I ended up doing this a completely different way - I realised I could use tokenat to just split the string up into words and count the characters in each. I gave my spritefont an instance variable called CharsPerLine to keep track of how many max characters to account for per line and then did this (source text is in a variable called textToProcess):

    Then you just call the processNewlines() function whenever you want it to do it!

    Works a treat, thought I'd share my solution for any future Construct users who have this problem

    (You don't need to use the areYouTyping boolean on the spritefont, I just have that because it's useful to know when the typing effect is in process)

  • If your idea is 2D, there will be a way to do it in C2, even if you don't know where to begin! Just break the problem into smaller chunks and tackle them one at a time

  • It may be an issue with the sound taking a second to load. Have you tried preloading the sound at the beginning of the layout?

    Otherwise, can you post a screencap of your events perhaps?

  • What about if you give the sprite an instance variable (text) and call it something like newAnimation. Then in events:

    • when you want to trigger animation 2, ie a shooting animation: set sprite.newAnimation to "Shooting"
    • first animation frame = 18 & sprite.newAnimation != "": set animation to sprite.newAnimation, set sprite.newAnimation to ""

    Basically every time it gets to frame 18 in animation 1 it checks to see if you've put the name of another animation into the newAnimation variable - if you have, it plays the new one and blanks the variable, otherwise, nothing happens and it keeps playing animation 1.

  • I had this same problem in my game and I got around it by adding an instance boolean to the player sprite called overrideAnimations and then testing to see if it wasn't true. eg

    if player is on floor & overrideAnimations = false : set animation to "Stand"

    player presses "hit" key: set overrideAnimations to true, play animation "Hit"

    animation "Hit" is finished: set overrideAnimations to false

  • Sure you can! A 2D array should suffice. x could be mob names and then all the values on the y axis could be attributes for that mob. eg

    (0,0) = Skeleton

    (0,1) = resistance fire

    (0,2) = rarity 5

    (0,3) = HP 100

    etc, and then the next mob is at

    (1,0) = Gremlin

    (1,1) = resistance water

    (1,2) = rarity 15

    (1,3) = HP 50

    and so on. Just make a note for yourself somewhere of what each Y-coordinate is for. Ie (x,0) is name, (x,1) is resistance, (x,2) is rarity, etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Even with "Trigger once"?

  • Iiiinteresting! OK, thanks for your help, I'll put your idea in the melting pot