|
Post by differentialgiraffe on Jul 8, 2024 18:53:34 GMT
![](//storage.proboards.com/3425386/thumbnailer/VLFGyDOuyqDpFzCbQpbH.png) Hello. I would like to add a rolling mechanic in MPAGD by pressing A[Down] and O or P at the same time to roll, and after 5 seconds, it stops and switches you back to its standing position. Also I noticed that jumping can make you roll, so if you touch an enemy with IMAGE = 2, the enemy will be defeated. I created a rolling sprite and frames for it, and FRAME = 2 Also resets when you move left or right or standing, it means that it's IMAGE = 1 or IMAGE = 0 and your current frame. And there's one more thing. If you stop moving left or right or standing left or right, it will not set your frame to 0, so it will set to your current walking frame.
IMAGE 2 (spin) Supposed to animate fast.
IF IMAGE = 2 ANIMATE FAST ENDIF
|
|
mas
Endorian Forest
![*](//storage.proboards.com/forum/images/stars/star.png) ![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 60
|
Post by mas on Jul 9, 2024 9:29:45 GMT
I would say setup a timer routine in mainloop1 - uses at least 2 variables
ADD 1 TO R IF R > 24 ADD 1 TO S LET R = 0 IF S > 59 LET S = 0 ENDIF ENDIF
then I'd look at the player sprite event trigger
I'm assuming you have something like
IF KEY DOWN LET SETTINGA = 1 ELSE LET SETTINGA = 0 ENDIF
IF KEY LEFT IF SETTINGA = 1 LET FRAME = 0 LET IMAGE = 2 ENDIF ENDIF
what I would probably want to do, is change the SPRITETYPE and have the rolling handled by that ... so I'd change the IF KEY LEFT bit to
IF KEY LEFT IF SETTINGA = 1 LET FRAME = 0 LET IMAGE = 2 LET TYPE = 8 LET SETTINGA = S ADD 5 TO SETTINGA IF SETTINGA > 59 SUBTRACT 60 FROM SETTINGA ENDIF EXIT ENDIF ENDIF
and then in your spritetype 8 event
;;; lots of rolling code IF S >= SETTINGA ;; 5 seconds up LET IMAGE = ;; whatever the original image was LET FRAME = 0 LET TYPE = 0 EXIT ENDIF
hope that helps
|
|
|
Post by ramon on Jul 9, 2024 10:39:56 GMT
Action pattern for my game:
Time line:
0 <-------------------+End_of_action---------+Init_Action
Usually: End_of_action = 25 frames (1 sec) Init_Action = 35 frames (1,5 sec) Inaction = 0 sec Alert_zone = 0 <-> 25 frames Concept in my mind: ; FRAME = cinematic sequence ; ANIMATE = play cinematic sequence ; IMAGE = cinematic action
EVENT PLAYER
; SETTINGB = MY WEAPON, 1-25 ALERT, 26-50 ACTION, 0 Inaction
; ACTION CLOCK IF SETTINGB > 0 SUBTRACT 1 FROM SETTINGB ENDIF ; CHECK ACTION IF SETTINGB > 25 ; ACTION ; Action IN PROGRESS LET IMAGE = I ; FACE LEFT IF DIRECTION = RIGHT ADD 1 TO IMAGE ; FACE RIGHT ENDIF ELSE IF SETTINGB > 0 ; ALERT ; Action FINISHED LET IMAGE = I ; FACE LEFT IF DIRECTION = RIGHT ADD 1 TO IMAGE ; FACE RIGHT ENDIF LET FRAME = 0 ELSE ; INACTION ENDIF ENDIF ; CONTROL ; SIMPLE IF SETTINGB = 0 ; ACCION CAMINAR IZQUIERDA LET IMAGE = 4 ANIMATE SLOW ENDIF ; COMPLEX IF SETTINGB < 25 ; ALERT! (1-25) IF KEY FIRE1 ; INIT ACTION LET SETTINGB = 35 ; INIT CLOCK IF DIRECTION = LEFT LET IMAGE = I ; FACE LEFT ELSE IF DIRECTION = RIGHT LET IMAGE = I ; FACE RIGHT ENDIF ENDIF LET FRAME = 0 ENDIF ; DESIGN IMAGES: FRAMES 0------------1------------2-----------3-----------ETC ALERT ACTION INACTION
This is how I'm developing my game now, I hope it inspires you all. ![;)](//storage.proboards.com/forum/images/smiley/wink.png)
|
|
mas
Endorian Forest
![*](//storage.proboards.com/forum/images/stars/star.png) ![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 60
|
Post by mas on Jul 9, 2024 10:47:04 GMT
Ramon, you have me curious as to what you're currently working on :-) some of those comments have me thinking of some sort of Metal Gear Solid style hide and sneak espionage style game. But maybe that's my imagination running wild. :-)
|
|
|
Post by ramon on Jul 9, 2024 10:50:08 GMT
|
|
|
Post by differentialgiraffe on Jul 9, 2024 10:51:44 GMT
Master Chief? I think its a HALO ZX Spectrum Game.
|
|
mas
Endorian Forest
![*](//storage.proboards.com/forum/images/stars/star.png) ![*](//storage.proboards.com/forum/images/stars/star.png)
Posts: 60
|
Post by mas on Jul 9, 2024 10:58:39 GMT
That looks incredible. My curiousity levels are only increasing. Look forward to seeing more as it progresses!
|
|
|
Post by differentialgiraffe on Jul 9, 2024 11:08:50 GMT
It is supposed to be a CONTRA based game
|
|
|
Post by ramon on Jul 9, 2024 11:17:50 GMT
The secret of actions is what I have shown you
|
|
|
Post by xavisan on Jul 27, 2024 20:23:44 GMT
Brillante como siempre. Brilliant brilliant as always ;-)
|
|