leocz
Menagerie
Posts: 10
|
Post by leocz on Oct 16, 2013 23:47:31 GMT
Hi guys, I'm starting to make my first game with this fantastic tool that is the AGD, I'm from Argentina, so excuse me for my English. The idea of the game is collecting items to go through several screens and once collected all objects allow exit with animated sprite .. The problem is that when I go back to the previous screen reappears previously collected object. How I can do to make the object once collected does not appear again?.
And the second question is how I can vary the speed of the animated sprite? .. going very fast!
|
|
|
Post by 10loadgameplay on Oct 17, 2013 17:45:11 GMT
Welcome leocz! You need to define the collectables as Objects, not Sprites. Define an object & put this code in the Player/ Event code: DETECTOBJ IF OBJ <> 255 GET OBJ ENDIF To slow down the animation put DELAY 2 into the MAIN LOOP 1 or 2 event but the whole game will run at half speed and slow everything down. OR to just slow animations In the Main loop put: IF A = 2 LET A = 0 ELSE ADD 1 TO A ENDIF Then insert this in the Player Control (Type 0): IF A = 0 ANIMATE ENDIF This should slow it down for you!
|
|
leocz
Menagerie
Posts: 10
|
Post by leocz on Oct 19, 2013 0:23:46 GMT
Hey, thanks! the problem of the speed of the animated sprite I've solved it with your help, but I'm having problems with collecting objects, I'll put the game to make it more clear example. In the first example an animation RZX "leocz1.rzx" we can see that the collection of objects works perfect, because you can collect objects of any screen and any order and activates exite animated sprite. In the other example "leocz2.szx" add a screen more, and added a more object but does not work. The idea is to collect the three objects in any order and activate the output sprite Attachments:
|
|
leocz
Menagerie
Posts: 10
|
Post by leocz on Oct 19, 2013 15:52:42 GMT
Yes!!, I solve the problem of collecting objects, the mistake was in Restart Screen where you remove everything and put Let = 0 in Game initialisation. A silly mistake but error end. Then the code would look like: In Game initialisation: Let I=0
In Player Control (type 0) DETECTOBJ IF OBJ <>255 GET OBJ ADD 1 TO I ENDIF
In Sprite Type 4 ( exit sprite animated): IF I=3 (n° of objects) ANIMATE IF COLLISION 0 ENDGAME ENDIF ENDIF
Thanks ... sure I'll come back with more problems
|
|
|
Post by Jonathan Cauldwell on Oct 19, 2013 17:24:25 GMT
If you use DELAY the whole game will slow down.
The best way to slow down the animation on an individual sprite is to write your animation code like this:
ADD 1 TO PARAMA IF PARAMA > 1 ANIMATE LET PARAMA = 0 ENDIF This will halve the animation speed of the sprite. Increase the number 1 if you want to slow the animation down even more. This way you can have different sprites animated at different speeds.
|
|
leocz
Menagerie
Posts: 10
|
Post by leocz on Oct 19, 2013 18:59:25 GMT
Thank you! Jonathan, probe code in a sprite collectible "coin" and works perfectly slowing but patroling Enemy Sprites as the ghost or spider probe the code and I have not worked, modifying sensitive probe of several ways the code but I worked. This is the ghost sprite code (patrolling enemy U / D) to which I added the code to slow: ADD 1 TO PARAMA IF PARAMA > 1 ANIMATE LET PARAMA = 0 ENDIF IF PARAMA =0 IF CANGOUP SPRITEUP ELSE LET PARAMA =1 ENDIF ELSE IF CANGODOWN SPRITEDOWN ELSE LET PARAMA =0 ENDIF ENDIF IF COLLISION 0 KILL ENDIF
|
|