Forum Replies Created
-
Thank you Alex!
Thank you Alex, this is a good boost in my efforts to make it work, i downloaded the file that you added and it is running ok on Corona SDK.
My only thing is that i cannot open it on kwik, even though it has its .kwk file in it.
I used Notepad++ to open the .kwk file and replaced the path of your system folder to mine, still i can’t open it 🙁I ‘ll try it again tomorrow, i may misunderstand something.. i don’t know.
Edit: I made the file to open right, i had to use the same name for the folder as the project and not some random one, so i did, it opened.
Lets summarize for anyone who needs to take the same steps as me: Alex kindly shared a zip file created with Kwik 3 for the memory game tutorial, now this file is working, but you have to open the memoryTest.kwk file in a text editor and change the path of the file (that point to alex folder in his computer) to your current path in your computer. This and keep in mind to have the folder of the project named as memoryTest will be all that you need to open the project in kwik.
Thank you both for your help.
-
This reply was modified 5 years, 4 months ago by
DELIVERANCE98.
I continually get the errors, even now that i made some changes thanx to Jorge (thank you again!).
the external code that i use is the following :
– verifies number of flips if (flips < 2) then — flips the clicked card composer.trans.newTransition_743 = transition.to( self, {alpha=0, time=1000, delay=0}) – blocks tentatives to press the same card if flipped[1] ~= self then –check if the entry is the same as the first one flips = flips + 1; if flips > 2 then flips = 2 end — updates the number of flips table.insert(flipped,self) — updates the content of flipped table end elseif flips == 2 then –second flip in the round flips = flips + 1 –; if flips > 2 then flips = 2 end – two flips made – blocks tentatives to press the same card if flipped[1] ~= self then –check if the clicked card is the same previous clicked composer.trans.newTransition_743 = transition.to( self, {alpha=0, time=1000, delay=0}) table.insert(flipped,self) — updates the content of flipped table – if you have more than 8 cards, you must review this line here, as it was written to capture only the last character of the picture name. – For example, p1_photo1 will return “1″. if (randList[tonumber(string.sub(string.reverse(flipped[1].name),1,1))] == randList[tonumber(string.sub(string.reverse(flipped[2].name),1,1))]) then –equal images, move buttons to out of screen flipped[1].x = 5000 flipped[2].x = 5000 flips = 1 — returns the number of flips to 1 flipped = {} –cleans the flipped table else – cards don’t match local function hideAgain() composer.trans.newTransition_898 = transition.to( flipped[1], {alpha=1, time=1000, delay=0}) composer.trans.newTransition_888 = transition.to( flipped[2], {alpha=1, time=1000, delay=0}) local function zeroesFlip() flips = 1 flipped = {} end composer.timerStash.timer_fl = timer.performWithDelay( 1000, zeroesFlip, 1 ) –timer to avoid users to flip other cards while the current ones are shown end composer.timerStash.timer_AP = timer.performWithDelay( 2000, hideAgain, 1 ) –timer to block the cards again, with the cover image end end end
and from another external file this:
– Shuffle cards
while #tList ~= 0 do –loops the tLista table until it is empty
local ind = math.random(#tList) — get a random number/position from the tList table
table.insert(randList, tList[ind]) –insert the selected card into table randList
table.remove(tList,ind) — remove the card from the tList table
end– Positions each photo
– olds each card position in the table (you can get this info from each Photoshop layer or
– simply Publish your project and read the coordinates from your Lua page
local cards = { {141,189}, {387,189}, {635,189}, {881,189}, {141, 378}, {387,378}, {635,378}, {881,378} }
local card = {} — table to draw each card
for i = 1,#randList do –loops the content of the randList
card[i] = display.newImageRect( composer.imgDir.. “p1_photo”..randList[i]..”.jpg”, 220, 165 ); — reads the external file with the card name
card[i].x = cards[i][1]
card[i].y = cards[i][2]
sceneGroup:insert(card[i])
end– This is not needed. I just added it to show in the console the new position of each card (so, you will be able to check where each card is in the board
for i,v in ipairs(randList) do print(i,v) endI tripple checked everything in Photoshop (CS6), i have the latest corona simulator and of course the latest Kwik (paid) plugin… still i get errors…
I dont get it. 🙁
p.s. Sorry for the code in the second part but it seems that the forum doesnt like two code windows in a row.
-
This reply was modified 5 years, 4 months ago by
DELIVERANCE98.
-
This reply was modified 5 years, 4 months ago by
DELIVERANCE98.
-
This reply was modified 5 years, 4 months ago by
DELIVERANCE98.
Thank you, I ll give it a second try.
Hi, im intrested in a similar way to do it.
I want to make a dice / card whatever of 8 or 10 posible outcomes, is it posible?
should i follow some specific tutorial for that?
Thank you.where are the links?!
http://s18.postimg.org/crj3t96if/PS_CS6.png
http://s3.postimg.org/rwijtl7f5/Corona_Error_Memory_Game.png
I think the forum ate the links to the screenshots.
also this too.
http://forums.coronalabs.com/topic/45891-converting-old-code-to-storyboard-issues/ -
This reply was modified 5 years, 4 months ago by
-
AuthorPosts