help with shapes based game

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
d.m.holdawayGA2553
Posts: 81
Joined: Mon Jan 09, 2012 4:48 pm

help with shapes based game

Post by d.m.holdawayGA2553 » Mon Jan 30, 2012 4:31 pm

Hello,

i am working on a game for my iPad that my young son can use.

i just need a little help with the logic, at the moment i can drag the shapes around the screen and i can drag them into the holes

but the issue i am having is that i can put circles into a square shaped box

what would be the best way to test that the right shape is going into the correct hole?

should i just use a if statement

if shape is wrong then display error else fill hole with shape.

any advice is welcome, i have worked though the online Game Academy lessons so if there is a bit that you think is relevant within the webinars please say and i will go back and re watch them

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: help with shapes based game

Post by sturgis » Mon Jan 30, 2012 5:09 pm

Hmm assuming you are creating the holes and shapes yourself (programatically) you can simply check whats what. Either name your objects (a hole named "square 1" and an object named "square 1") then you just have to compare the names of the 2 objects. if the short name of the object being dragged matches the short name of the object its being dropped on then its correct, otherwise say so and move the object out of the box. The same could be done with custom properties of each object. Say a listing on your square hole, which objects are allowed to be dropped there.

If asking about the actual mechanics and code of such a solution rather than just a pointer in a direction post again (possibly with your current drag code so answers can be more tailored to your current methods)

Post Reply