I think I have bumped my head....
Khestral
Member Posts: 8
I cannot for some reason figure out how to do a simple game like catch dropping fruit in a basket...
Is there some examples of this type of thing out there? I seem to be unable to find the if they are.
Thanks!!!
Is there some examples of this type of thing out there? I seem to be unable to find the if they are.
Thanks!!!
Comments
Let's set the score attribute.
When you open up GameSalad, above the actor pane on the left you will see three tabs; Actors, Attributes and Devices
Click on attributes and click the + symbol in the bottom left of the window.
Choose 'integer' and then re-name the new attribute 'Score'
Now click the 'Actors' tab at the top to take you back to the actors tab.
You need to make four actors.
The first actor is your player, in this case a basket. (basket case?)
Name the actor 'basket'.
Add a basket image into the 'images' section and drag this up to the actor.
Double click the actor and make the image the size you want (the size value on the left hand pane)
Add a rule saying 'if attribute changes' - key - is left
Then into this rule drag a 'Move' behaviour. Set the direction 180 relative to actor
Set the speed to what you want (90 is reasonable).
Create another rule saying 'if attribute changes' - key - is right
Into this rule drag a 'Move' behaviour. Set the direction 0 relative to actor
Set speed the same as before.
These two rules are your left and right movement.
Now onto your second actor. The fruit. Name it 'Fruit'.
Drag a fruity image into the 'images' section, then drag it from there to your second actor.
Double click on the fruity actor/
Add a 'Move' behaviour. Set the direction to 270 relative to actor. Set the speed to whatever you want.
Create a rule 'Actor receives event' - collides- with instance of type - basket
Drag a change attribute behaviour to the rule.
Click on the first 'e' button.
The attribute browser will appear. Click on Game, then choose Score. It should appear in the change attribute display as game.Score
Then click on the second 'e' button after To:
The expression editor will appear. Click on the down arrow. Again, click on game, and choose Score again.
In the text window above, it should read game.Score. Add a +5 (or whatever you want) after the game.Score text so it reads game.Score+5.
Click the tick.
Now add another behaviour, 'Destroy' to the rule.
This means the fruit will move down, and if it collides with the basket it will disappear and give you 5 points.
Now we need another new actor.
Call it 'Dropfruit' and drag a timer into it. Set the timer to 'Every' 5 seconds (or whaterver).
Then drag a Spawn Actor behaviour into the timer.
In this behaviour, just change the 'Spawn a new' to 'Fruit'
Finally, make a new actor. Call this 'Score'
Drag a 'Display Text' behaviour to this actor.
Click on the 'e' button and choose Game, then 'Score' as you have done before.
On the left hand pane, make sure you set the alpha to 0. You can find this setting under 'colour'.
Now, go back to your scene.
Drag the basket actor to somewhere along the bottom of the screen.
Drag the 'Dropfruit' Actor to somewhere along the top of the screen.
Put the score somewhere (top right maybe).
Play your game!
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
-JGary
If you haven't, I can't help. If you have, I told you last week. Have you forgotten?
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
MUAHAHAHAHA etc etc
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
In fact, just compress your game files and send em' on over here please, be a good lil' sous chef
I'll create your graphics for free if you create my game for me(sans-images)
What say yey?
*but I won't
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Sorry for asking like that but I was frustrated and I couldn't find what I was looking for I am seriously new to all this and I'm trying to make a game for my daughter... Thanks a ton for the info and next time I promise to do more detective work!
Thanks again!
We weren't disrespecting you by any means. You have to understand that we are a very light-hearted group here. We joke & have fun. If you felt disrespected or thought we were poking fun at you, that was not the case. We were actually poking fun at Quantum, for giving such a detailed response. So sorry if it came across in any other way!
-JGary
Purple Alligators
Ahahahahaha! *choke* :P
Khestral, I hope your daughter enjoys her game!
As for you, JGary, I see your Purple Alligators and raise you an Albino Blue Whale!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
No hard feelings ! I think that's really sweet that you're making a game for your daughter
I think it's great that you asked, we are a very open, and laid back forum, just go and look at all the questions I asked, and you'll feel better
Good luck with your game, and please, if you have any other questions, ask away! It helps those of us who don't know programming like savvy Quantum Sheep over there, and thus, why we harass him nonstop to meet our demands to make games for us
I just don't know why he won't agree to our demands already? Give it up Quantum!
I love the openness trust me... I am coder deficient so i know I ask some goofy questions Trust me no disrespect felt here
What I did was created a separate invisible actor called: Spawn "name of actor" and placed it onto the screen, and added a timer, and location of spawn (this is otherwise known as an actor controller, and the player can't see it, but it controls elements in the game like score, spawning of actors, etc)
Then the "actor" itself, in your case, the fruit, you can add the attributes like move: put direction 270 if you want them to fall straight down, and at what speed: 25 and that should work
You also need other attributes in your fruit actor like bounce, collides rule etc
Trust me, I am very coder deficient, and it's taken me months to get accustomed to using GS, and I still have questions
Hope this helps
Spawn actor: "fruit"
Position : you can place the word Random in there so the fruit drops randomly from the sky (In my case, I put random (10,470) on the arrow facing right ---> and on the arrow facing up: you can put 310 (that way they will start to spawn at the top of the screen.
If you're tree is lower on the screen, and not at the top, you can play around with those x and y axis numbers depending on where on the screen you want them to spawn
Hope this helps!
Also I am having issues with wrapping of actors on the screen, I know this is most likely easy but I was thinking of somehow telling it to not go outside the boundaries... is this possible?
So create another invisible game controller, say spawn "apple" and create an actor prototype with the image apple. Same thing for a different type of fruit.
I think you can also do this another way, but this was much easier for me, and has worked so far!
Yes, you can tell the actors to stay within the boundaries of the screen.
What I did was changed the numbers under the position (I think under spawn actor fruit), and under the position, I changed the x position (arrow facing right ---->) to random (10,470) and kept it relative to scene.
On the y position (arrow facing up), I just put 310 so they spawn just at the top of the screen. Again, you can play around with these numbers until you're satisfied.
What the x axis numbers (10,470) did was keep the actors from showing up on the borders of the screen, and you can play around with those numbers until you're happy!
Also, to prevent fruits from dropping over and over, and cycling, once they hit the ground, you can destroy actor so they don't keep reappearning. I'll have to go home and look at how I did this, but you place a coordinate, if y is less than 2, destroy actor, or something to that effect.
Hope this helps!
Just pick whichever works better for you.
OR:
You can create a game attribute called "game.drop letters" and add rules in there which gets a little more complicated, and would require some learning, and definitely some help from the sous chefs on here
Wish I could help you more on this!
Since you require dropping so many letters, there must be an easier way to do this than have to spawn each letter individually, so good luck!
If it's based off a set time then:
Create ACTOR Attribute called "Letter"
Create rule that every x secs change "Letter" to random (1,26)
Then a rule that if
Actor.Letter = 1 spawn actor A
Actor.Letter = 2 spawn actor B
etc...
Create your actor for each letter.
As far as making random times there was a thread somewhere on here that explained a way to do it. I can't remember that one off hand.
There is no easy way to do this. None that I'm aware at least.