kittiewan's Forum Posts

  • Since I never played Yu-Gi-Oh, I'm not 100% sure what you want. But here is a shot at it. I'll talk about the cards as if they are a standard 52 card deck with 2 jokers for 54 cards total. You can adapt to your own deck.

    I'll also be referring to my Memory match tutorial, which shows how to make the Memory Match card game in the Arcade.)

    I would create one sprite with two animations: Card face and Card back (like in the Memory Match example.) The Card face animation would have one frame for every different card in the deck (54 frames.)

    When the card is turned face down you play the Card Back animation. When it is turned face up you play the Card Face animation and set the frame to the frame assigned to that card.

    -----------------------------------------------------------------

    EDIT: Changed next few paragraphs to show 2 options for organizing and use division and modulus operators to determine the card suit and number.

    Create two instance variables on the card object: Suit and Number.

    When you create the frames, you might want to organize the frames of cards so that all of the cards of a suit are together in order, or so that all of the card numbers are together. In either case, put the jokers at the end.

    If want to organize by suit (Ace Spades, 2 Spades, 3 Spades, ...Ace Hearts, 2 Hearts, 3 Hearts...Ace Diamonds, 2 Diamonds, 3 Diamonds...Ace of Clubs, 2 Clubs, 3 Clubs...Joker, Joker.)

    To find the suit of the card:

    if Card.animationFrame <52

       Card.Suit=floor(card.AnimationFrame/13)

    This gives 0 for spades, 1 for hearts, 2 for diamonds and 3 for clubs.

    To find the card number:

    if Card.animationFrame <52

    Card.Suit = Card.AnimationFrame%13

    This gives 0 for Ace, 1 for 2, ...10 for Jack, 11 for Queen and 12 for King.

    If you organize the cards A Spades, A Hearts, A Diamonds, A Clubs, 2 Spades, 2 Hearts...

    To find the suit of the card:

    if Card.animationFrame <52

       Card.Suit=card.AnimationFrame%4

    This gives 0 for spades, 1 for hearts, 2 for diamonds and 3 for clubs.

    To find the card number:

    if Card.animationFrame <52

    Card.Suit = Floor(Card.AnimationFrame/4)

    This gives 0 for Ace, 1 for 2, ...10 for Jack, 11 for Queen and 12 for King.

    End EDIT

    --------------------------------------------------------------------

    Now you need to create an array containing one value for each frame in your card face animation, and insert the numbers from 0 to 54 in the array and shuffle the deck (as shown in the memory match tutorial.)

    Now create the card instances and assign a card frame to each, storing it in an instance variable. EDIT: In addition, use one of the approaches above, depending on how you sorted your card frames in the card face animation, to assign the value of Card.Suit and Card.Number.

    From this point on your card objects can be treated just like regular real world cards. You can move them to different locations -- the hand, the deck, the extra deck, etc.

    Hope that helps.

  • Hmmm. Not sure what more you want, but here is a picture of the pertinent part of the event sheet from Jailson's example (the second one Kyatric linked to above.)

    <img src="http://dl.dropbox.com/u/57899112/RotateAroundObjectEvents.PNG" border="0" />

    The first action in the Every Tick event is the one that makes the orbit.

    The two global variables, radius and speed, are required since they are used in the first action. Radius of course is the distance of the orbiting object from the center point, and speed is the speed at which it travels in its orbit.

    Centerpoint is object about which other objects orbit (in your case it would be the sun.) Object is the object in orbit. (In your case it would be a planet.)

    The second action angles the object to follow the orbit path as it moves around the centerpoint. For a round object like a planet, you may not need. Instead you might put a rotate behavior on your planet to make it rotate on its axis as it travels about the sun.

  • Do you mean at design-time or runtime?

    At design-time, copy and paste (on the toolbar or use Ctrl-C/Ctrl-V or right click and copy or paste) should work fine for single or many objects at once. Remember that when you paste in the new layout you'll see the + mouse pointer and need to click to place the pasted object(s).

    If you are talking about at runtime, you can't copy from one layout to another, but you can create an instance of the object using System-> Create Object so long as an instance of the object appears on at least one of your layouts, however you are creating a default version of the object, not pasting a copy from another layout. I don't usually use it, but you can experiment with the global setting for an object if you want to maintain its state across layouts.

  • I can think of a real application of this--I'm trying to do something similar with dust particles in a platformer. The faster the player goes the further I want the dust particles to trail out behind. I'm no physicist, but this seems intuitively correct since the player has covered more distance in the time it takes for the dust to fall to the ground.

  • When you place a tiledbackground or sprite it is empty until you assign it a graphic in the animation editor. If you are doing this, then...

    Four things to try:

    1) Reboot your computer if you haven't already.

    2) Uninstall and reinstall Construct 2.

    3) Try it on a friend's computer to see how it should look.

    4) Update your graphics drivers, like you said.

  • Kyatric and TL22 are right--making an adventure game with C2 is quite doable, but no small undertaking.

    I don't know if it will help you, but here is my "port" of part 2 of sciDave's "Mikey's Adventure" from Construct Classic to Construct 2. You should do some of the standard tutorials first (like the ghost shooter and platform tutorials) so that you understand what is going on.

    Forum Thread: Mikey's Adventure for C2

    Capx: MikeysAdventure_pt2_noInventory

    Since I never heard back from scidave I dropped the idea of redoing his tutorial. If enough people are interested, I could make another adventure game tutorial from scratch.

  • Beautiful! Thanks for sharing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Much more challenging than it seems at first glance! Definitely worth working on!

  • This capx contains several combinations of dragdrop and pin behavior on textboxes and sprites.

    TextBoxPinBugs.capx

    1) DragBox doesn't work on a textbox. This seems reasonable, although you can sort of click on the border without the textbox getting focus for editing so it seems like it might work. EDIT: Also, if you disable the textbox you can drag it, so I think this is probably okay.

    2) If textbox has pin behavior and sprite has dragdrop behavior and you pin textbox to sprite, drag works, but textbox wiggles around rather than being pinned securely in place.

    3) If the sprite has both pin and dragdrop behavior and sprite is pinned to textbox, the sprite doesn't drag. This may be as intended, I'm just not sure.

    4) Even though the textboxes have the default height (22) they are resized bigger when run. I've noticed that text resizes, but usually it gets smaller, not bigger.

  • You do not have permission to view this post

  • Try doing a search for farmville and you'll find plenty of threads discussing whether such a game can be built in C2. Essenatially, yes you can create the simulation/management game. The difficulty is when you add in the social networking aspects of the game.

    The latest such threads:

    Simulation Games Like Restaurant City

    Can C2 Make Social Games

  • .dcr is a shockwave file created with Director. You need Adobe Shockwave Player to run it.

    Like sqiddster said, easy!

  • Glad to help.

    Inside the draggableText drop event, after the check to see if ObjectImage is overlapping draggableText, there are two more subevents to see if draggableText.Text does or does not = an instance variable created on ObjectImage called Description. For this to work, when you create each instance of the ObjectImage, you have to set its description to the same as the matching text.

  • Thank you, thank you Tokinsom and ramones! I really appreciate your taking the time to look into this. I figured it needed some lerping. I got it to go forward pretty smoothly using vectorx, but it kept snapping back to the original X position at the height of the jump. ramones, your solutions just what I had in mind.

  • Help! Little Bunny FooFoo is hopping through the forest, but when he jumps he just goes straight up. I want him to jump towards the center of the window so that it looks like he is surging forward and then as he falls move back towards the left.

    I have no clue.

    LittleBunnyFooFoo.capx

    EDIT: I should have mentioned that the goal is to make something Canabalt-like. The player uses platform behavior with the default controls disabled, and on touch simulate jump. The scenery continuously scrolls in the opposite direction to the player.