|
Post by djcaye on Mar 21, 2022 14:33:14 GMT
Hi, and excuse my English; does anyone knows how to implement a punch o or Kick (or some kind of whiplash)? I have tried many versions of code but it does not work.
And another question; how can Implement a counter for the objects that I have collected? I have try in event player a regular script after define detectobj (if obj = 4 (in case that's the number of the object) add 1 to obj ) but nothing happens to the objects number (also happens to lives, well... happens but in the score do not sum 1 to lives, but I get 1 live).
Regards.
|
|
|
Post by luiscoco on Mar 21, 2022 15:17:51 GMT
For counter Use A...Z (not X and Y) Display Counter whith DISPLAY
|
|
|
Post by djcaye on Mar 22, 2022 13:33:43 GMT
Thanks a lot!!
I will try this week (I'm out due to work issue) and I will tell you; and I read that you have a AGD for Amiga, It could be possible to share with us?? I am a Amiga User I think could be so nice to start using this!!
Regards!!
------
|
|
|
Post by luiscoco on Mar 22, 2022 21:41:40 GMT
Soon, still going for 50%, editor at 90%, Runtime game 0% and stand alone can be
|
|
|
Post by Packobilly on Mar 23, 2022 8:27:34 GMT
As Luis says, every time you modify the value of a variable, you have to update it on the screen. If you add 1 when you pick an obj, you must then include DISPLAY + variable that stores the number of objects. The variable you have chosen, do not add 1 to obj… Greetings!
|
|
|
Post by djcaye on Mar 23, 2022 18:49:54 GMT
ok, thank you so much for your explanations!!! Regards! luiscoco ok!!! I am sure it is a Huge development !!!! and I am also sure that worth it!!! Regards!!
|
|
|
Post by djcaye on Mar 23, 2022 21:15:07 GMT
I´m here again!!
I tried but how I interpreted your instruction it does not work...
this is a part of my script (evente player)
EVENT PLAYER
DETECTOBJ
IF OBJ = 255
ELSE
GET OBJ
BEEP 120
IF OBJ = 0
ADD 1 TO LIVES
DISPLAY LIVES
AT 23 21
BEEP 120
ENDIF
ENDIF
IF OBJ = 3
ADD 1 TO KEY
DISPLAY KEY
AT 23 5
ENDIF
.......
and in the GAME INITIALATION I declare this
EVENT GAMEINIT
LET OBJ=0 AT 23 5 PRINT "KEY:" DISPLAY KEY
LET LIVES = 5 AT 23 21 PRINT "LIVES:" DISPLAY LIVES
Edit:
I notice that the lives update but in another place of the screen (and it´s weird, because a set a location screen with (for lives)
AT 23 21
Sorry for my incompetence with pseudo coding!!!
Regards and many thanks!!!!
|
|
|
Post by Jonathan Cauldwell on Mar 23, 2022 22:00:31 GMT
I´m here again!! I tried but how I interpreted your instruction it does not work... this is a part of my script (evente player) EVENT PLAYER DETECTOBJ IF OBJ = 255 ELSE GET OBJ BEEP 120 IF OBJ = 0 ADD 1 TO LIVES DISPLAY LIVES AT 23 21 BEEP 120 ENDIF ENDIF IF OBJ = 3 ADD 1 TO KEY DISPLAY KEY AT 23 5 ENDIF ....... and in the GAME INITIALATION I declare this EVENT GAMEINIT LET OBJ=0 AT 23 5 PRINT "KEY:" DISPLAY KEY LET LIVES = 5 AT 23 21 PRINT "LIVES:" DISPLAY LIVES Edit: I notice that the lives update but in another place of the screen (and it´s weird, because a set a location screen with (for lives) AT 23 21 Sorry for my incompetence with pseudo coding!!! Regards and many thanks!!!! AT needs to go before DISPLAY not after it, KEY isn't a variable and you're misunderstanding how OBJ works, It shouldn't be used as a counter. Perhaps try this instead: EVENT PLAYER
DETECTOBJ
IF OBJ = 255 ELSE ADD 1 TO O ; count objects collected in O variable GET OBJ BEEP 120
IF OBJ = 0 ADD 1 TO LIVES AT 23 27 ; set display position DISPLAY LIVES ; display lives variable BEEP 120 ; this is redundant, BEEPs only happen at the end of the main loop so the first BEEP already does this ENDIF
IF OBJ = 3 ADD 1 TO K ; not sure why you're doing this, you can only collect each object once ; and there's a function to tell you when an object has been collected AT 23 9 ; set display position DISPLAY K ; display keys collected ENDIF
ENDIF
EVENT GAMEINIT
LET O=0 ; reset objects counter LET K=0 ; reset key counter AT 23 5 PRINT "KEY:" DISPLAY K
LET LIVES = 5 AT 23 21 PRINT "LIVES:" DISPLAY LIVES
|
|
|
Post by djcaye on Mar 24, 2022 6:46:44 GMT
Thank You so much Jonathan and, of Course, thanks for the Awesome MPAGD!!!! an honor to read you answer in my post!!!!
Regards!!
|
|
|
Post by djcaye on Jul 30, 2022 9:44:36 GMT
I am here again with the first part of this post; I am trying to develop a whiplash or sword instead a bullet as a weapon (I mean, working as a Sword, hitting).. does anyone have scripted something like this?
Regards.
|
|
|
Post by oss003 on Jul 30, 2022 16:22:13 GMT
Here is an example of having a whip as weapon. You can also change the frames of SPRITE1 to have a sword. Press O/P/SPACE for left/right/Whip You can see the code in the EVENTS in the AGD file. Whip.zip is an MPAGD v0.7.10 project. Greetings Kees Attachments:whiptest.tap (8.59 KB)
whiptest.agd (10.23 KB)
Whip.zip (3.95 KB)
|
|
|
Post by djcaye on Aug 2, 2022 19:10:07 GMT
ThankYou So Much!!!!!!
|
|