I've created a little project that generates a grid on the screen instantly (providing the grid isn't massive) without using loops and timers. It's like the replicate behaviour but each actor is independent and can have it's own attribute values.
Place the grid square actor where you want the top left of your grid to be and it will create the grid of your chosen size from that when the game is loaded. You can change the size of the grid by changing the game attribute values. You can easily change it so that the bottom left of the grid is the starting point if needed.
Another test project from the archives . . . . place blocks in a scene (by clicking) and have them join together into a contiguous shape.
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
I started to lay out a grid of rows and columns of DisplayText actors in order to show table data for saved games on the educational app I'm building. It's tedious to code that many things and then arrange each actor one by one (there would have been over 100 separate actors). And worse, I'm working with camera origins on a single large scene so every time I exit an actor's rules, I get taken back to the default view and have to scroll around the scene. But enough complaints!
I realized I should follow my own advice that I give to students and automate. So I built a little demo that recursively spawns (it's reeeeaaally simple so don't be scared off by that word) a grid view of table data.
Heres another way to do animations without using the animate behavior, it's very easy to do, some of you might find it useful for cutscenes, sorry my mic is broken but I point at what is needed it's very easy to do.
The first video shows both versions one using the GS animate behavior at 30fps and my version using interpolate which easily out performs and using 19 images.
This video below shows it using 250 images rendered at 1136x640 using interpolate to control speed.
Heres another way to do animations without using the animate behavior, it's very easy to do, some of you might find it useful for cutscenes, sorry my mic is broken but I point at what is needed it's very easy to do.
The first video shows both versions one using the GS animate behavior at 30fps and my version using interpolate which easily out performs and using 19 images.
@tatiang -- nice demo of reading tables with spawned actors. I especially like your use of |T| in a table name. That really makes tables stand out in a list.
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
edited November 2013
@RThurman, thanks! And I've been using the |T| designation for some time now and find it quite useful to keep track of my table attributes. Just hoping the GS team finds a clever way to implement something like that in the next version of the attribute viewer.
Just more cropped so that the surface looks closer to the camera.
You could throw a camera into the scene and zoom in, ie: scale the camera (don't forget to accommodate the zoom in the resolution of the thing you are zooming in on).
Or if you don't want to use a camera 'zoom' then all you'd have to do is to scale up the relevant values in the constrain behaviour that's in the spawner actor:
self.A= the height / depth of the bumps. Currently an attribute that interpolates, but you are free to change the values around - the only reason it is interpolating is that I thought it would be good, occasionally, to interoperate it down to 0 to create some flat regions - rather than a constantly undulating surface.
game.Time*B = B is the 'width' of the bumps/dips.
Play around with those two values - the self.A value and the values that appear after "game.Time*. . . . . "
Collect items which are then stored in your inventory.
Select and deselect items. State of doors and items saved in tables.
Correct item 'key' will open corresponding door and unlock scene of your choice. Item 'key' can be discarded or kept.
'Display text' debugging on doors. (you can turn 'doorIndex' on and cheat).
I've created custom item behaviors to save time. Though there are only three places to change code for each item, 7 items x 7 scenes add up to quite a few changes.
Notes are in the rule/group headings. There are 7 doors, 7 items.
These are controlled by 7 game attributes A > G. To add more items and doors simply add game attributes H > Z after Z you could always start again at AA. Then add rows or columns to two of the tables. There are three tables. One is for the inventory slot to store its position. When the item overlaps the inventory slot, the slot moves out of the way and the item is stored on the inventory tray. (you could make the 'InventorySlot' visible to see how this works).
There is a table to store the door state open shut, true false. And for the items mainly to keep them where you want them to be.
What it doesn't do:
Can't at this stage get touch is pressed or released to work on the doors quite the way I want. So when you've opened the door. Bad luck. you have to go through it. I don't mind that, but it's not the classic point click behavior and it's annoying that I haven't found a fix.
Also if you interpolate your item too quickly onto the Inventory slot it will drag the item as it moves.
Probably more stuff I'm not aware of.
This is a thank you to the GS community for the learning I've received I'd be delighted for any feedback.
Comments
Free Mini Games and Demo Templates
Darren.
Cheers ! >-
Are you trying to suggest I'm a one-trick pony ? I don't know what you are talking about )
https://www.dropbox.com/s/iochsh5wl1wq6hl/GameSalad-Instant-Grids.zip
Place the grid square actor where you want the top left of your grid to be and it will create the grid of your chosen size from that when the game is loaded. You can change the size of the grid by changing the game attribute values. You can easily change it so that the bottom left of the grid is the starting point if needed.
What?!? You have a trick pony?
Doesn't that violate the TOS?
As long as I'm not in the same room as the pony while he's logged in they can't prove anything.
I've just downloaded 150 odd files from 9 pages, and now wish that I looked at them as and when they were shared
@Socks, I might use your shadow example in a future update of my Doodle Kicks game. Thanks.
Shadow !? What's that ??
:-/
P.S 'Doodle Kicks' great name, but get zeitgeisty and lose the space.
DoodleKicks™
I realized I should follow my own advice that I give to students and automate. So I built a little demo that recursively spawns (it's reeeeaaally simple so don't be scared off by that word) a grid view of table data.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Good stuff ! This is the kind of thing that's probably very useful to the right person >-
The landscape is ever-changing, it keeps on evolving as it's procedurally generated.
Arrows control the absolutely terrible stand-in guide spaceship.
The first video shows both versions one using the GS animate behavior at 30fps and my version using interpolate which easily out performs and using 19 images.
This video below shows it using 250 images rendered at 1136x640 using interpolate to control speed.
Nice stuff !! >-
By the way, GameSalad's animate behaviour when set to 30fps actually runs at 23.5fps.
Kinda' cheating 'procedural' as I'm putting in the occasional flat area
★ My Apps | Gamesalad Tutorials : Youtube Channel , Website. ★
@Socks, it needs more Mr. T.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
★ My Apps | Gamesalad Tutorials : Youtube Channel , Website. ★
: )
Flying too close to the ground again ?
You could throw a camera into the scene and zoom in, ie: scale the camera (don't forget to accommodate the zoom in the resolution of the thing you are zooming in on).
Or if you don't want to use a camera 'zoom' then all you'd have to do is to scale up the relevant values in the constrain behaviour that's in the spawner actor:
(( self.A *0.66)*sin( game.Time *6))+( ( self.A *.12)*cos( game.Time *88))+( ( self.A *.18)*sin( game.Time *112))+( ( self.A *.55)* cos( game.Time *12))+( ( self.A *.1)*sin( game.Time *56))+( ( self.A *.09)*cos( game.Time *165))+384
It's a bit of a mess, but . . . .
self.A= the height / depth of the bumps.
Currently an attribute that interpolates, but you are free to change the values around - the only reason it is interpolating is that I thought it would be good, occasionally, to interoperate it down to 0 to create some flat regions - rather than a constantly undulating surface.
game.Time*B = B is the 'width' of the bumps/dips.
Play around with those two values - the self.A value and the values that appear after "game.Time*. . . . . "
What it does:
Collect items which are then stored in your inventory.
Select and deselect items. State of doors and items saved in tables.
Correct item 'key' will open corresponding door and unlock scene of your choice.
Item 'key' can be discarded or kept.
'Display text' debugging on doors. (you can turn 'doorIndex' on and cheat).
I've created custom item behaviors to save time. Though there are only three
places to change code for each item, 7 items x 7 scenes add up to quite a few changes.
Notes are in the rule/group headings. There are 7 doors, 7 items.
These are controlled by 7 game attributes A > G. To add more items and
doors simply add game attributes H > Z after Z you could always start again
at AA. Then add rows or columns to two of the tables.
There are three tables. One is for the inventory slot to store its position.
When the item overlaps the inventory slot, the slot moves out of the way
and the item is stored on the inventory tray. (you could make the 'InventorySlot'
visible to see how this works).
There is a table to store the door state open shut, true false.
And for the items mainly to keep them where you want them to be.
What it doesn't do:
Can't at this stage get touch is pressed or released to work on the doors
quite the way I want. So when you've opened the door. Bad luck. you have to
go through it. I don't mind that, but it's not the classic point click behavior
and it's annoying that I haven't found a fix.
Also if you interpolate your item too quickly onto the Inventory slot
it will drag the item as it moves.
Probably more stuff I'm not aware of.
This is a thank you to the GS community for the learning I've received
I'd be delighted for any feedback.
ZZZZZZip! >>>
I don't get the pretty zip picture.
I'll try again. Here >>