farflamex's Recent Forum Activity

  • I would but I don't know how to add a screenshot to these forums :(

  • I did switch it around as you suggested, and it still works. But still no luck with the other problem. For now I'll do the update every tick, but I'll keep looking into it as it seems like it should work in the creation event.

  • Well you're right, the other way around does work just as well, but the problem is, that part was working anyway :)

    The part that isn't working is where I set the animation frame. The frame is set to a number, which is set in the editor for the newly created object, in an instance variable 'Iconframe'. It seems to always set the frame to the final frame in the sequence.

    So what seems to happen is, the object is created, it creates the icon, it matches up the variable with the UID, then it tries to set the icon animation frame with the variable, but can't do so. The variable is definitely set correctly because if I set the animation frame on every tick using the exact same action, it shows correctly.

  • I'll try to work that out. It's strange, that's what's happening. My object is in a family, maybe that's part of the problem?

    In typing, here's what I have....

    EnemyShips(family) on Created - System : Create object 'Icon' on layer 0

                                 - Icon : Set 'Match' to EnemyShips.UID

                                 - Icon : Set animation frame to Enemyships.Iconframe

    That's probably not padded correctly, but the gist of it is, create the icon when an object in the 'Enemyships' family is created. Set the variable 'Match' to the UID of the new object. Those two parts work.

    Then set the animation frame of the new icon to the value in 'Iconframe' which is set correctly in the editor for the objects. This part doesn't work.

    Maybe it's something to do with using families in this case?

  • I have a situation where, when an object is created, it creates a matching icon, which copies the main object's UID (so I can keep the two matched up) and then sets the animation-frame of the icon, depending on a value stored in an instance variable of the created object. This is because all of the icons are single-frame and stored together as a single object, 1 to each frame (makes other parts of the program simpler).

    Slightly complex explanation, but here's the bit I'm having trouble with. I do the above in an 'On created' event. The first two parts work, it does create a matching icon, it also correctly sets the variable for the icon, to the UID of the created object. But then it doesn't set the animation frame for the icon, based on the variable in the newly created object.

    Only thing I can think of is, when it's inside the 'On created' event, are the new object's variables set before the actions take place? Because the variable is set in the editor but it won't transfer into the animation frame of the icon.

    The only solution right now (which works but seems wasteful) is to set the animation frame every tick. Once it's got past the 'On created' event, the variables all seem to be in place.

    I guess my question is, when I do an 'On created', are the instance variables which I've typed in editor immediately assigned, or aren't they assigned until after that event?

  • That happens to me all the time, I can't work something out, then I put up a post and 5 minutes later I've solved it. It's as if writing it out makes it clearer in your own head :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Excellent replies guys, and a big thank you :)

    This is exactly what I need as I had a feeling there was a better way than I was describing. I was particularly confused about how I'd get the image to show at the edge of the screen, since the screen is rectangular so it's not just a case of showing the objects at a certain distance and angle from my spaceship. This describes that very well and without it it would have taken me forever to work out :)

  • I have a situation where my game objects can disappear off the edge of the screen, but continue to exist. The player needs to know where these objects are so that he can track/follow/avoid them. Rather than a radar, I prefer the idea of having little icons which float around the edge of the screen, in the direction of the objects.

    I'm trying to work out the best way to do this. One idea I'm thinking is that when the object is created, an icon object is created at the same time, with some sort of ID for both - i.e they could both have a variable which is set to the same value. The game then needs to check each frame to see if the object is on the screen - if it is, the corresponding icon has it's visibility turned off - if it isn't, the icon is made visible and it's position calculated. And of course, when the main object is destroyed, the icon has to be destroyed too.

    This would probably work but sounds a bit intensive and fiddly.

    Is there a better way of doing this?

  • Having the same problem on this, and my other game http://www.kongregate.com/games/farflamex/survivors-2

    When you use the arrow and space keys, it scrolls the entire screen around to keep the frame in view. What's causing this? I put them both down with the screen size I used, 480x640, but both screens have scroll bars and I assume using the space key for pause is a bad idea in a browser? How do I fix the screen resolution issue?

  • Outworld

    A vertical scrolling shooter with a bit of strategy thrown in. You must fend off the enemy bombers while simultaneously keeping your eye on your colony supplies. Mined ore can be spent on ship upgrades, oxygen supplies or new crew.

    This is my second C2 game, again a rewrite of a game that I'd written in code a few months ago. Another massive thumbs up to Scirra as this only took about 10 hours over a few evenings to put together (the graphics were already in place from the previous write of course).

  • Hi everyone,

    Been here a while, but never introduced myself and I'm keen to get the 25 extra points so that I can post links on the forum <img src="smileys/smiley36.gif" border="0" align="middle" /> . Mainly because I have 2 finished games already and I put one of them up on the arcade without a proper link and it never even got rated due to lack of plays.

    Have to say I'm hugely impressed with C2. Very easy to use, but the clincher is, it's powerful as hell. The two games I've written were already written in code a few months ago and I simply converted them over to C2 for practice. Since the graphics and ideas were already in place, it was incredibly easy and each only took a few hours to throw together, but most importantly, one of them actually runs far smoother than the code version I did. Currently working on a far more complex game although I may have got carried away and I think it may slow down a bit on older PC's

    <img src="smileys/smiley36.gif" border="0" align="middle" />

    Anyway, my name is Glynn, I've been coding since 1984 and have used many game creators along the way, but never stuck with one because they've all been so bad. Hurray for C2 <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Works perfectly. Glad I asked on here because I'd gone stupid and was coming up with all sorts of bizarre solutions in my head. This is the obvious and simple way, thanks :)

farflamex's avatar

farflamex

Member since 7 Oct, 2012

Twitter
farflamex has 15 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies