-
large deck
hi, I'm making a simple trading card game.
Ive made a picture which changes depending on an internal value.
there are +350 pictures. When i test the application it gets slow so my question is:
how can I make a card that can be randomly chosen to be any of the +350 cards without making the game so slow.
thnx in advance
-
Re: large deck
Destroy at start of frame. Load on call. Destroy after a card is done being used. Have cards either be in groups in a single active, or have each card as its own active, and only have one in memory at a time. Use one of the many randomization extensions available as MMF's random makes too much of a pattern.
-
Re: large deck
-
Re: large deck
It is still slow :( ill try to explain my procedure maybe im doing something wrong.
my card picture has the following behavior:
if internal value 1 ---> change picture to 1
if internal value 2----> change picture to 2
...
...
if internal value 350 ----> change picture to 350
In my frame i have a card object and a button that changes the internal value (adds 1).
I'm creating the slide show which shows the cards you have. i could easily restrict which cards to show but problem is the application is slow each time I click the button that changes the internal value.
Ive noticed that when using a button to increment the internal value the problem is gone after a while and i can swiftly change the images; however this does not happen when i use a list and set the internal value of the card to the list selection.
thanx in advance
-
Re: large deck
Add limit conditions->only one action when event loops. Upload an MFA and one of us can probably tell you specifically what is wrong.
-
Re: large deck
Dont code every event like that, do this:
+ Always
- set picture to internal value
You just need to use some way of putting the images in a specific order so that the image number matches the internal value number. I would suggest using the Background Image Object for this as you can place the corresponding card image in the requires image slot and then the above event should be all you need.
-
Re: large deck
ive been massing around with it and i noticed something else, it only gets slow when i go back to the first image (turn internal value to 1) so this probably wont matter much since it just freezes for a couple of seconds so you could say the problem is resolved, but in case you have nothing to do I have uploaded an .mfa file and the pictures needed.
thanx for everyone's help.
ill post a copy when the game is done since its just for fun.
file
http://rapidshare.com/files/247947549/game.rar.html
Dear God T_T Ive never seen the expression button on the file browser when changing a picture; this makes 5 hours of work pointless...o well live and learn :P
again thank you all.
-
Re: large deck
Well you shouldnt really be getting slowdown so I would assume its with your events somewhere. I'll check it out.
Here you go. Fixed. http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=150137&#Post150 137.
This is basically similar to what I mentioned above. It just sets the card number relative to the selected line number in the list.
One thing you need to make sure is that you dont actually write the exact file pathname when selecting the image as other users wont have that same folder structure. You will see I used Apppath$ which returns the full application directory as a string allowing the file to be placed in any folder.
-
Re: large deck
Hello. I use a public acount taken from www.bugmenot.com because I'm too much of a ***** to register and be a part of my community.
My password has been changed to a random string of numbers.
This action has been taken by a forum member, not by a moderator or anyone associated with clickteam.
-
Re: large deck
Thank you, thanx to both of you I have designed a system that not only works, but will also work whit the deck building and the actual playing.
I made it so, that the image is loaded by a global string:
Apppath$+"Nueva carpeta (2)/images/"+Global String A+".jpg"
and changing the global string to the name on the list, so I now have control over each of the cards properties.
My next step is to make an array that contains all the strings (cards) and from there add the cards the user has into the list.
My question is:
Is there a way to add all the strings at once into an array?
As always thanx in advance