kcmd's Forum Posts

  • 9 posts
  • what is is the condition to check to see if a sprite does not have any other sprite overlapping it?

  • Hey that one works pretty good.

    Thanks for your time.

  • NP, thanks for that example

    that is essentially what i had already started with but also mentioned that the problem is that all the "System" Events are occurring at the same time when the function is called or the event occurs.

    So in your example when the Enter key is pressed each sprite does rotate separately and that is what i already had but not desired outcome.

    Problem is i need 1 to complete before the next is started such as putting in the "Wait 5 seconds".

    I currently have each action in a new function so that i can have it wait before calling the next function. But the code for it grows cumbersome.

    So in your example i would want to rotate the first sprite then wait 1 second before the next sprite is rotated and so on.

    If i had 100 sprites for example that would mean 100 calls to a function to perform some actions then another 100 functions to call if i want to perform different actions. So thats my dilemma

    I couldn't get it to work in sub events either.

  • Im sorry but either i dont understand that or your not understanding my question.

    I can't add a condition to the action, only the Function Event. I want the action to change the IID.

    In general :

    Function ( On "Testing")

    Action = choose sprite with IID 1

    Action = rotate the sprite selected above 45 degrees

    Action = wait 5 seconds

    Action = choose sprite with IID 2

    Action = rotate this particular sprite counter clock wise

    "I'm trying to apply actions to each of the sprites with a certain IID separately "

    The way i accomplish that now is :

    "choose sprite with IID 1" is located in another Function then called on from "Testing"

    It is a System Event and will apply when that function is called then all the actions will apply to that IID as well.

    I dont know if this is the only way but id rather have all the particular code in 1 function.

  • I add an object to the layout then copy and paste it a few times to create the instances.

    I want to be able to switch from one IID to another through "Action"... but it seems the only way to pick the IID is through System Event. I dont want to use UID as i know my IID's.

    I have created a Function with actions

    I want the Actions to pick the object with IID 1 then perform actions on that instance

    then pick IID 2 and perform actions on that instance.

    I'm not sure if i have the structure wrong but the only way i see to change or pick the IID is in a system event but all the system events in that Function happen all at once and not in sequence.

    Im finding i have to create a new separate Function each time i want to change the selected IID.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • After a lot of experimenting it would seem i can't swap images between sprites and I'm assuming because they are framed animations and there is no image property as there is in Windows programming.

    You are right about how to handle the deck and shuffle. Im going to use an array with a depth of 2 so i have Frame, Suit and Value. Then use the old fashion bubble sort with the array instead. After the array is mixed up i can change each cards Frame according to the array then assign the depth values to their Instance variables.

    I appreciate your help and suggestions... I'm sure ill be back for more as i have just started my first app.

    Thanxs

  • Unfortunately no.

    The sprites are going to be a deck of cards. So the easiest method is the Bubble sort.

    Temp1.image = Sprite1.image

    Sprite1.image = sprite2.image

    Sprite2.image= Temp1.image

    Each sprite will have 1 image and random #'s will swap them. There can be no doubles, so swap is the easiest to shuffle a deck.

    Loading 52 images per card then changing the Animation frame is overkill.

  • If i have Sprite1 with a specific Image and Sprite2 with a specific image and want to swap their images. I know i will need a temp sprite to rotate them I'm just not sure of the Event Action code. I have tried with Load Image From URL or data URI but no success.

    Im new to construct2 so any help is appreciated.

  • I am very new to this type of design. I am a VB programmer in .NET and already have a public played card game.

    Looking to see if Construct 2 would be the best way to expand my game to all platforms.

    Can anyone suggest templates or samples available for a deck of cards including shuffling, dealing and animations and maybe multiplay? Don't want to waste all my time on the basics of card games and just focus on the strategy code.

  • 9 posts