L4T3NCY's Forum Posts

  • 12 posts
  • Hi guys, I'm going to continue this thread here with my own "Tower Defense Context Menu" problems.

    I have based my current context menu on sparkdad's design and am currently stuck at how to "Sell Towers". How to sell towers is really just a symptom of the larger issue being, "I'm not very familiar with the C2 UID & IID" and menus are currently not instanced contextual to what you've clicked. I've looked at the existing UID guides/tutorials but, they were hard to apply to this case. :(

    I've made this capx to try and explain my problem. In this capx when you click to SELL it will obviously just sell ALL existing towers as it isn't discriminating between any of them yet.

    docs.google.com/open

    Any help on how to differentiate between what you've just clicked and only apply changes to it using the UID (or better method?) would be much appreciated. ^^o

  • Hi everyone,

    So the slot/lotto machine ended up going well at the End-of-Year Company party. Staff won prizes and merriment was enjoyed by all!

    There was no other examples of what I wanted here yet (chrisbrobs thatnks for trying!) so, I'm posting the full capx for anyone to use at their own party if they want. ^.^ Have tried to comment the capx everywhere as much as possible.

    docs.google.com/open

    DISCLAIMER: This is SUPER hacky.. but it got the job done. With only a few hours on weeknights and weekends to do this, it didn't need to be pretty code-wise, just work. I've since removed all the photos of people/prizes and the propriety art, so the capx just has my orsum stick drawings in it now as replacements. It's enough for you to get the idea though. The random number generation uses kittiewan's "Generating Random Numbers Without Duplicates" tutorial (which is solid!).

    Notes:

    -The slot spinning effect is purely for show. Even if a person/prize has come up before, they will show up in the spinner as it is only animating the sprite for show. I wanted to find a way to remove staff/prizes as we went along eventually whittling the staff/prize lists down but, ran out of time. This got the job done.

    -There are actually 2 random generators for the prizes. The first one occludes the last few frames of the prize sprite (which contained the Grand Prizes). After a certain number of spins, I stop using the 1st generator with the limit, and switch to the no-limits generator allowing for the possibility of a Grand Prize coming up. This way you guarantee a Grand Prize will come up somewhere towards the end and not on the 1st damn spin.

    -To increase/decrease the number of staff/prizes just play with the Global Variables at the top. I didn't get time to cleanly rig everything up to be pointing at just 1 place though, so you'll need to hand adjust the "countdown" global here & there as well to match your number of prizes.

    -Having the keyboard not accept inputs until spinning has ended was critical! After a few drinks, people will just hammer that Spacebar if they're gonna win stuff so, it needed to be robust. :D

    If anyone has any questions (or suggestions on cleaner ways to achieve these results!) feel free to comment. ^^/

  • Oh wow.. the "Animations" window position defaulted to behind the "Edit Image" window so I never saw it. Well that explains multiple animations per sprite then. ^^; Cheers.

    My current capx is a mess of 3 different approaches. :(

    I'm not necessarily set on the idea of using the animation frames to achieve the result. It only crossed my mind after seeing how you did your slot machine on that older thread.

    I would prefer to just store all my lotto numbers in an array, then associate a sprite with each number to display. As a number comes up, I could move it to the back of the array (or delete it?), then re-draw from the leftover numbers until eventually only 1 number is left in the pot.

    The animation frame example seemed easier to get the 'slowly coming to a stop on a number' effect by slowing the animation down with: self.AnimationSpeed - ((10*self.AnimationSpeed/100) * dt)

    or whatever. But I could never figure how to ignore/delete a frame once it had come up, which made me think to store a list of the lotto numbers in an array and just associate each one with it's respective sprite.

    The original "Random Unique Number Generator" tutorial I saw does this perfectly, but doesn't give any of the visual excitement of "coming to a rest" on the winning number each time. It just instantly spits out the unique number.

    So I'm torn between these two methods atm. :( Unless there is (quite likely) a better way to achieve a lotto machine that I'm not thinking of. Cheers for the advice guys.

  • Heya Chrisbrobs,

    Cheers for the ideas. Yeah I originally had a long look at that thread of yours and tried the animation frame idea. I'm having a look at the capx you just posted as well while revisiting that thread. So here comes stupid question. :D

    Where are your sprites for when the reel has stopped? As in, I see oranges and cherrys in browser when running it, but I can't find them 'anywhere' in the capx. I've even looked inside every sprite's animation frames as well. -_-

    On the note of using animation frames, is there a way to delete or 'skip' animation frames during runtime? I thought of removing each frame as it came up, 1-by-1, so they wouldn't show up on subsequent spins, until eventually there'd just be the 1 last frame left spinning and inevitably win?

  • Yeah, I had a look at that example as well. All of his fruit are in 1 sprite strip though, so I can't remove any of them once they come up (say the cherrys for example). The sprites are baked into that ticker tape strip.

    That's why I was thinking to have the sprites each separate in a list and called somewhere, so they can be left out after coming up?

  • Hi guys, I've looked at all the slot machine and number generator threads (in particular the "Generating Random Numbers Without Duplicates" tute) but can't figure out a way to do the following:

    I'm trying to make a lottery/slot machine that picks a winner from a list every spin (then deletes itself from the list), until eventually every object in the list has come up only once and it's "empty" at the end.

    I've managed this as a simple random number generator but, that doesn't help the slot machine, which needs to visually 'spin' through each object's sprite, slowly coming to a stop on the winner for that spin. Only objects still in the list should appear on the spinner. The final spin would be just 1 sprite spinning around I guess.

    Any ideas? Cheers guys.

  • Hi Guys,

    So I've had a dig around and couldn't find anything specific on this topic. I've also spent a fair bit of time trying different methods and haven't got anything satisfactory yet so, thought I'd throw open the floors to ideas and caps.

    PROBLEM:

    2 player game on a touch device. Each player has 1/2 of the screen as "their space". Touching points within their space pops up a menu (calling the same menu each time regardless of which point they touch. Have been trying to pick UID here).

    Obviously want both player's touches to function independently within their spaces and NOT interfere with each other's menus.

    I tried making 2 big transparent sprites to 'define' the touch spaces with collision, but that hasn't worked so well. Have also been having trouble picking the UID for each point so that any menu selections are applied to the selected point (until menu is closed).

    Anyone else made any synchronous 2 player games on a touch device with Construct yet?

  • Yeah, that totally worked. ^^ Cheers dude.

  • Heya guys,

    Another super low-level question that hopefully has a really simple answer. o^^o I've dug around on the forums and couldn't find anything addressing this directly so thought I'd ask.

    I have multiple instances of "enemy01" on screen and would like to put a "marker" on them. I thought I would be able to simply:

    Always, for each enemy01 -> marker: set position to object enemy01 (image point 1)

    Obviously the marker isn't showing up though. I'm clearly missing something which I hope is elementary. Does anyone know of a better way to go about this or a simple solution? Cheers guys.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah, this is good news. ^^

    Is that this one here?

    scirra.com/forum/plugin-input-system-v096b-21-03-2011-keyb-mouse-joy_topic40990.html

  • Is everyone just using the keyboard for their games? I thought more people would have been using Construct as a prototyping tool for PSN/XBLA, thus the 360 controller.

    Again, if anyone has any experience using the 360 controller with the platform behaviour or any new custom inputs they've made in general, would be great to hear from you.

    Cheers guys. ^^/

  • hi guys, ^^/

    I'm having some trouble using the "Xbox 360 Controller" object in my platformer. The n00b questions now follow: ^^;

    1. When turning left & right with the keyboard my sprite & animation flips correctly

    Player 1 "Move Left" is down (Player 1 "Move Right" is NOT down)

    ->

    Set animation angle to 180.

    But when using the 360 controller the sprite refuses to behave, despite the control still being pointed to the input "Move Right". The only difference I can see is "Keyboard Left Arrow" or "Left Thumb-Left" triggering the control input "Move Left (P1)".

    2. I've made some new control inputs of my own, EG: "Attack". I've assigned it to Space on the keyboard but have also tried assigning it to 360 controller buttons. The keyboard version works fine, plays animation but the 360 controller doesn't seem to call the control. Again, only difference I can see is between what is calling the input (either Keyboard "Space" or 360 "X button").

    I'm surprised at how much trouble I'm having just mapping some new attacks/controls to a button on the 360 controller when they already work on keyboard.

    If anyone else has some experience with that Xbox 360 Controller object, or can see a problem, please let me know. ^^b

  • 12 posts