Based on a tutorial about how to do an atari game, I'm trying to follow the same logic to achieve the same but with gamesalad.
http://www.tinkernut.com/2010/01/05/how-to-make-an-atari-game/
Gamesalad is a "from scratch" game engine, that let you develop a game without write one single line of code and being able to deploy to a good number of platforms, like ios, android, html, windows, mac. Im not going deep about gamesalad features.
The point is that, with no experience in gamesalad i want to try do a similar game-tutorial like described above.
Well, you don't need write any code but you are not free from thinking logically.
After a while actually, for me, its being annoying so many clicks around to get things working.
No that I'm such a brilliant programmer (because I'm not) but sometimes a think some things could be solved with a little lines of code.
In an any programming language i could make an enemy chase the player with something like:
"
If enemyPositionX < playerPositionX
Then
enemyPositionX = enemyPositionX + 2
"
And so on.
With this code being part of the game-loop then we can update the enemy position to near the player position and then take care about the collision.
In game salad i create an actor, its like a game object that represents my enemy and another one that represents my player.
Then i wanted to create a new behavior, that will put some logic to this object.
But i cant reach another object attribute from here, like the player actual position.
First thing we could do is create some attribute (variable) in our "game" object. Really makes sense but like my nature is always make it harder i tried work with tables.
Tables are objects like an spreadsheet but i would like to think more its like a big array object. Yes, thats it.
Then i create this table and signed initial value to zero. Next i need to populate this cell with player and enemy positions.
So i went to each actor and created a rule that says, every 0.0 seconds, write the position xy in my table object.
If i don't put this "write table" rule in a time loop like this, then we got the values in table cell just one time, when we created the object.
I know already that using Time and Move behavior are cpu consumer but i can change to best work arounds like Game.Time attribute and Interpolate behavior, later.
Then when i used similar rule as described in the beginning of this post, things become so lag in the game screen.
No, no, its cant be like this, so simple running every-second- tick-a test to move the enemy to the player value.
Ok, i will try the Game object attribute instead write and read from a table. Lets see what happens...
I still thinking that should be easier if i could write some if-then statement.
But its part of learning new things. Hope i can learn fast and well to really enjoy this technology. But i miss write my own rules instead clicks and drag and drop objects....
Comentários