When moving over area, change color & calculating percentage of area
MarcoCol
Member, PRO Posts: 279
Hi,
In my game I want that the player moves over the field, and where he just move,the color of the gound should be change some brighter. Also the area should be calculated in percentage, how muchmhemstillmhas done.
How can I do that?
It is a bit like a game where you must mow the gras and win only if you pass over xx percent.
In my game I want that the player moves over the field, and where he just move,the color of the gound should be change some brighter. Also the area should be calculated in percentage, how muchmhemstillmhas done.
How can I do that?
It is a bit like a game where you must mow the gras and win only if you pass over xx percent.
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ok. So i must have thousands of different gras actors?
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Must I put them each by hand? That would be a lot of work...
Use a spawner actor and a fast loop to spawn all of those actors onto the scene at positions determined by a table.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Will the game slower using as much actors?
So I must set each position in the table? Or can I also made something as a raster, set each same space, wich works like the duplicate-behavior?
You can either use a table or a mathematical formula (e.g. spawn at currentColumn*actorwidth, currentRow*actorHeight).
I did a quick test and it's beast. Even spawning 1000 actors with a single HyperLoop (currently the fastest looping method) takes several seconds. Of course, you could create a spawning system that uses multiple spawner actors (e.g. one for each "row" on the screen"). It's going to take some complex coding, but if you're up to it, it is possible.
I can't really speak to performance as I haven't worked with that many actors at a time but I did something similar to make a 2-dimensional mini map for a 3-dimensional maze and with about 400 actors there was no noticeable lag.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I had a look on the HyperLoop-Methode a but I didn't understand it. I will have a closer look in the next days.
It would be good to place them not by hand. I think I will then choose the size of 5x5 for each actor and place them each 5px in the size of the area.
Did you have a hint for me?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I will have a closer look on it.
I need "only" a loop at the start of the level, which spawned xxxx actors automatically all 5px (for example) in a field, which size is for example 800px x 250px.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
But I think it would be more simple if I spawn all those actors and destroy them when collide with the player actor, right? I had a lot of tries, but I didn't get them spawned automatically. When I place them by hand for test, that what I want to do works great.
So spawining the ground-actors is still my problem ...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The second methode works good and I can very easy and accurate count, how much area was finished.
I have a very close look on the FastForLoop example, but sorry, I didn't understand it.
Maybe my thinkings are wrong. But I am not able to get the machanism in my head to spawn fast thos actors in a set rectangle.
Where am I wrong? Can you help me please?