Look for some code help/understanding. THANKS YOU!

Barry2

Member
Hey everyone!

So I've been messing with Nesmaker now for a little over a year. I have put it away for about 8 months do to being confused on somethings. Some are so simple. I've been back at it now for about 2 months and making progress. I seem to still have a hard time with some of the coding of Nesmaker. I know it would help if I could work with someone directly. I have a concept, levels, player animations ect.

Thinks i need help on...

Game over screen
Check points
Cut screens
Death screens
ect....

Ive watch alot of the tutorials and some seem to help other just are alittle bit out of my league. Ive ask for help on the form but sometime i think its to simple for anyone to reply. I feel bad but if im asking i just dont understand what im doing wrong. I sit and work on my project daily.
If there is anyone out there willing to take the time out to explain some of these things step by step a bit better that would be great. If payment for time is need im willing to do that for your help!
Im working with Metrovaina platform in nesmaker 4.5.9

Thank you for anyone for at least considering!!
 

tbizzle

Well-known member
I do believe there is a "checkpoint tile" that you can use for save points. There is a little more to it than just using the tile. I have to look into it though, I used them in my game.
 

Barry2

Member
Thank you! I did see the Checkpoint tile in one of the platform tutorial but wasnt sure if it would apply in the Metrovaina platform. I havnt got that far in my game yet but that is something that i will want to use. Right now im trying to figure out how to get my game over screen to work right. Cant seem to get it right. I thought it would be a wrap but i was wrong. Im trying to find a script that will got to my game over screen when my life has been used up. Like i mention in my post it seem to be the little things that i can wrap my head around :confused:.

Ive been trying to research codes and scripts to help understand on how it works.

@tbizzle THANK YOU for that reply
 
Last edited:

dale_coop

Moderator
Staff member
If you search on the forum, you will find about those topics:

And maybe more ... (use the search function)
 

chains

Member
I'd argue to start with something fundamental, like a one-screen arcade game with simple mechanics. This way, you work through until the end of the project, figure out important and basic stuff like this. Then, you can start playing around with Metroidvania games.

But assembly is not easy. Nor is programming. Nor is hacking around the engine to figure out what others did. So I wouldn't recommend it if you don't know anything about programming or computers. Instead, start there first or pair with someone that already knows. I saw many people trying around NES Maker just because they ad the "no-code" thing. The problem is, the more you go deep into it, the more you figure that you will need that knowledge.

I highly recommend reading this article: https://www.matthughson.com/2021/11/17/how-to-start-making-nes-games/.

(funny enough, Matt links back here. But since he hasn't experienced NES Maker, I wouldn't add nes maker in the category "no-code")
 

Barry2

Member
If you search on the forum, you will find about those topics:

And maybe more ... (use the search function)
Thanks for the reply. Yes ive been looking at this all week and still cant seem to put the script in the right place.
Im on the form everyday looking at the things i need trying to find a way to make it work for me
 

Barry2

Member
I'd argue to start with something fundamental, like a one-screen arcade game with simple mechanics. This way, you work through until the end of the project, figure out important and basic stuff like this. Then, you can start playing around with Metroidvania games.

But assembly is not easy. Nor is programming. Nor is hacking around the engine to figure out what others did. So I wouldn't recommend it if you don't know anything about programming or computers. Instead, start there first or pair with someone that already knows. I saw many people trying around NES Maker just because they ad the "no-code" thing. The problem is, the more you go deep into it, the more you figure that you will need that knowledge.

I highly recommend reading this article: https://www.matthughson.com/2021/11/17/how-to-start-making-nes-games/.

(funny enough, Matt links back here. But since he hasn't experienced NES Maker, I wouldn't add nes maker in the category "no-code")
Thank you! I understand what you are saying. start with a simpler game to learn more about the code and to play around with it to learn how nesmaker works. would you recommend me doing a game the joe has already done and playing with that scripts or try my own game and learn a code on a simpler platform? Im really determent to learn this
 

Barry2

Member
@Barry2 make sure to set the screen to win screen also to have a legit end screen. View attachment 5701
So i have set my game over screen to a win screen and when i run out of life i still reset to my start screen. Any ideas. Ive look at the code and topic that @dale_coop had posted on this tread and im not getting anywhere with it. Im 100% sure its something that im doing wrong. Im just trying to find out what it is. Ive been looking all week, but ill keep digging and see if i can see if i missed something. Again thank you for taking the time to reach out to me!!
 

chains

Member
Thank you! I understand what you are saying. start with a simpler game to learn more about the code and to play around with it to learn how nesmaker works. would you recommend me doing a game the joe has already done and playing with that scripts or try my own game and learn a code on a simpler platform? Im really determent to learn this
That's a good start! Take one of the tutorials and try to improve it with new mechanics or with something you want to do. Eventually, you can change the sprites and tiles to come up with something new.

Don't play around with scrolling just yet, can be a real PITA.
 

Barry2

Member
Have you place the code in the handle player hurt script?
Could you share your script?
Thanks @dale_coop for the reply!!!! Yes this is the script that im using.
;;;;;;;;;;;;;;;;;; Presumes there is a variable called myLives defined in user variables.
;;;;;;;;;;;;;;;;;; You could also create your own variable for this.

LDA gameHandler
AND #%10000000
BEQ +canHurtPlayer
JMP +skipHurt
+canHurtPlayer:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; is the monster below our feet?
;;;;;;;;;; and are we moving downward?

+doHurtPlayer
TXA
STA temp
GetActionStep temp
CMP #$07
BNE +canHurtPlayer
JMP +skipHurt
+canHurtPlayer
;;; will presume there is a variable myHealth
;;; and that player hurt state is action state 7.
GetActionStep player1_object
CMP #$07 ;; hurt state.
BEQ +notAlreadyInHurtState
DEC myHealth

BMI +healthBelowZero
BEQ +healthBelowZero
JMP +notDeadYet
+healthBelowZero

JMP +playerHealthIsZero
+notDeadYet
UpdateHudElement #$02
ChangeActionStep player1_object, #$07
;; recoil
LDA #$00
STA Object_h_speed_hi,x
STA Object_h_speed_lo,x
STA Object_v_speed_hi,x
STA Object_v_speed_lo,x
LDA xPrev
STA Object_x_hi,x
LDA yPrev
STA Object_y_hi,x
+notAlreadyInHurtState
LDA Object_x_hi,x
CLC
ADC self_center_x
STA tempA
LDA Object_y_hi,x
CLC
ADC self_center_y
STA tempB
TXA
PHA
LDX otherObject
LDA Object_x_hi,x
CLC
ADC other_center_x
STA tempC
LDA Object_y_hi,x
CLC
ADC other_center_y
STA tempD
PLA
TAX

;;; RECOIL L/R
;+recoilHor
LDA tempA
CMP tempC
BCS +recoilRight
LDA Object_direction,x
AND #%00001111
ORA #%10000000
STA Object_direction,x
JMP +skipHurt

+recoilRight
LDA Object_direction,x
AND #%00001111
ORA #%11000000
STA Object_direction,x
JMP +skipHurt

+playerHealthIsZero:

LDA continueMap
STA warpMap

LDA continueX
STA newX
LDA continueY
STA newY

LDA continueScreen
STA warpToScreen
STA camScreen


LDA myMaxHealth
STA myHealth



WarpToScreen warpToMap, warpToScreen, #$02
;; arg0 = warp to map. 0= map1. 1= map2.
;; arg1 = screen to warp to.
;; arg2 = screen transition type - most likely use 1 here.
;; 1 = warp, where it observes the warp in position for the player.


+skipHurt
 

Barry2

Member
I was able to get my start screen right with out the buffer screen by using a wrap screen to my first game screen. That took out the buffer. I was trying to follow along with post that you had shown me, which ive seen before and i think i got a little lost in the mix with it. I seen someone tell me to set my game over screen as win screen. Then the post said something different. I learning how to read the scripts a little, im pretty determent to learn 6502 assembly but im still new to it but slowly getting it. I DO THANK YOU GUYS FOR THE TIME AND HELP. It seems all my free time is to understand this code. Alot of you guys are so awesome with it. Ill get there.
 

Barry2

Member
That's a good start! Take one of the tutorials and try to improve it with new mechanics or with something you want to do. Eventually, you can change the sprites and tiles to come up with something new.

Don't play around with scrolling just yet, can be a real PITA.

That's a good start! Take one of the tutorials and try to improve it with new mechanics or with something you want to do. Eventually, you can change the sprites and tiles to come up with something new.

Don't play around with scrolling just yet, can be a real PITA.
Thats good advice! Thank you ill give it a try. Im learning alittle at a time, but im determined to understand this
 

dale_coop

Moderator
Staff member
looks like you haven't implemented, in your script, the code from the message I shared... that message (by PassGaming) :

In his code, one part is important, it checks the lives... and if no more lives, the script will warp to a Death Screen.
You need to use a code like that, in your script (maybe right after the "+playerHealthIsZero:" line).

That code:
Code:
    Dec myLives
    LDA myLives
    BNE myLivesNotZero
        ;JMP RESET ;; game over.
        ;;;; also could warp to game over screen here instead.
        
    WarpToScreen #$01, #$FF, #$01  ;;This is warp to UNDERWORLD, LAST SCREEN this is for me because 8x8 , #$01 is normal warp;;

    ;; arg0 = warp to map.  0= map1.  1= map2.
    ;; arg1 = screen to warp to. use mouse to find coordinates = #$yx use hex convertor.
    ;; arg2 = screen transition type - most likely use 1 here.
        ;; 1 = warp, where it observes the warp in position for the player.
    ;;Don't Forget to set WARP IN COORDINATES ON YOUR MAP!;;

    JMP +skipHurt

myLivesNotZero:
 

Barry2

Member
looks like you haven't implemented, in your script, the code from the message I shared... that message (by PassGaming) :

In his code, one part is important, it checks the lives... and if no more lives, the script will warp to a Death Screen.
You need to use a code like that, in your script (maybe right after the "+playerHealthIsZero:" line).

That code:
Code:
    Dec myLives
    LDA myLives
    BNE myLivesNotZero
        ;JMP RESET ;; game over.
        ;;;; also could warp to game over screen here instead.
      
    WarpToScreen #$01, #$FF, #$01  ;;This is warp to UNDERWORLD, LAST SCREEN this is for me because 8x8 , #$01 is normal warp;;

    ;; arg0 = warp to map.  0= map1.  1= map2.
    ;; arg1 = screen to warp to. use mouse to find coordinates = #$yx use hex convertor.
    ;; arg2 = screen transition type - most likely use 1 here.
        ;; 1 = warp, where it observes the warp in position for the player.
    ;;Don't Forget to set WARP IN COORDINATES ON YOUR MAP!;;

    JMP +skipHurt

myLivesNotZero:
So i was wounding where to put this code at and how do i know where to put it at? I had taken it out because i was getting a error on my code. I seen where i should put this in my code, but i guess im asking is how do i know to put it there. When i set my coordinates to my map do i put that in the code? For example, WarpToScreen #47, #$FF, #38 (just and example of numbers). Also would like to know is, i have a warp coordinates on my game screen 1 to warp there from my start screen is that going to mess up this code? Sorry for all the question and i do thank you for your time

Ive been trying to also play with sound effects and i know the code is Playsound #sfx_xxxxx but i cant seem to find where to put it in the code. I will get a error every time.

Again thank you for you time and patience with me. Im really trying to understand code and read up on it everyday.
 
Last edited:

dale_coop

Moderator
Staff member
That code is needed if you want to warp a certain screen (determined by yourself) when you don't have lives anymore = warp on a Game Over screen.
It's where that code should be (in the handle hurt player script... where the player loses a life, and what to do in that situation (if still have more or not).

The coordinate for that Death/GameOver screen needs to be hard coded, in the code, yes. The meaning of the 3 parameters (the values) is explained in the comments:
Code:
    WarpToScreen #$01, #$FF, #$01  ;;This is warp to UNDERWORLD, LAST SCREEN this is for me because 8x8 , #$01 is normal warp;;
    ;; arg0 = warp to map.  0= map1.  1= map2.
    ;; arg1 = screen to warp to. use mouse to find coordinates = #$yx use hex convertor.
    ;; arg2 = screen transition type - most likely use 1 here.
    ;; 1 = warp, where it observes the warp in position for the player.

The first value is always #$00 or #$01 nothing else! it's the map, overworked or underworld.
The second value is the screen number on that map... the screens are numbered from 00 to 255 ($00->$FF in hex), the first screen on top-left on a map is 00 and the last one bottom-right is the 255th ($FF)... for example, in that script, the game over screen is the last screen of the map, the value is #$FF or #255 (you can write it in decimal or hex).
The last parameter is the type of warp... a normal warp is 1 (it uses the warp in coords of the destination screen)

If you have errors when you Export & Test, please, share them! screenshot or copy/paste... and share your modified scripts too. Else it's really difficult for us to help you.


About the playsound issue... please make a dedicated topic (donc mixes issues in a same topic).
 

Barry2

Member
Thanks @dale_coop, This makes alot of sense on how to enter in what screen. I was confused with the coordinates, I thought it was a x/y value, as in x=15 y=15 So this helps ALOT to understand!! I also understand the overworked and underworld now! Thank you for that help!


So I imported your code into my hurt player scripts, I didnt get any error code but when i die i just fall into black screens over and over. Not quite sure how to fix that. Here is the scripts that im using for it. On my screen (which is 255 as well) I do have it set as a main screen. I wasnt sure if i need it to be set to a game state or not. I know if i do that i would have to set it up like my start screen and give it a command to press a button (most likely start) to move back to the Start screen from there. I wasnt sure if that was a problem. Ive tried to change it to a win screen or game state screen but then when i died i just went back to my start screen. With out mixing up more that one problem on this post, i did notice when i get hit by a monster i will lose life, but when i hit again i will give me life. That is something that im also going to look into, but i wanted to make sure that didnt interfere with death screen code by any change.

;;;;;;;;;;;;;;;;;; Presumes there is a variable called myLives defined in user variables.
;;;;;;;;;;;;;;;;;; You could also create your own variable for this.

LDA gameHandler
AND #%10000000
BEQ +canHurtPlayer
JMP +skipHurt
+canHurtPlayer:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; is the monster below our feet?
;;;;;;;;;; and are we moving downward?

LDA Object_v_speed_hi,x
BEQ +doHurtPlayer ;; equal to zero
BMI +doHurtPlayer ;; or negative
;; here we are moving downward.
TXA
PHA
LDX otherObject
DestroyObject

CountObjects #%00001000
BNE +notZeroCount
LDA scrollByte
ORA #%00000010
STA scrollByte
;;; if there are no more monsters left, we want to disable
;;; the edge check for scrolling.
LDA ScreenFlags00
AND #%11101111
STA ScreenFlags00
+notZeroCount
PLA
TAX

;; Do a hop
LDA #$FC
STA Object_v_speed_hi,x

JMP +skipHurt

+doHurtPlayer

TXA
STA temp
GetActionStep temp
CMP #$07
BNE +canHurtPlayer
JMP +skipHurt

+canHurtPlayer

;;; will presume there is a variable myHealth
;;; and that player hurt state is action state 7.
GetActionStep player1_object
CMP #$07 ;; hurt state.
BEQ +notAlreadyInHurtState
DEC myHealth

BMI +healthBelowZero
BEQ +healthBelowZero
JMP +notDeadYet
+healthBelowZero
JMP +playerHealthIsZero
+notDeadYet
UpdateHudElement #$02
ChangeActionStep player1_object, #$07
;; recoil
LDA #$00
STA Object_h_speed_hi,x
STA Object_h_speed_lo,x
STA Object_v_speed_hi,x
STA Object_v_speed_lo,x
LDA xPrev
STA Object_x_hi,x
LDA yPrev
STA Object_y_hi,x
+notAlreadyInHurtState
LDA Object_x_hi,x
CLC
ADC self_center_x
STA tempA
LDA Object_y_hi,x
CLC
ADC self_center_y
STA tempB
TXA
PHA
LDX otherObject
LDA Object_x_hi,x
CLC
ADC other_center_x
STA tempC
LDA Object_y_hi,x
CLC
ADC other_center_y
STA tempD
PLA
TAX

;;; RECOIL L/R
;+recoilHor
LDA tempA
CMP tempC
BCS +recoilRight
LDA Object_direction,x
AND #%00001111
ORA #%10000000
STA Object_direction,x
JMP +skipHurt

+recoilRight
LDA Object_direction,x
AND #%00001111
ORA #%11000000
STA Object_direction,x
JMP +skipHurt

+playerHealthIsZero:

DEC myLives
LDA myLives
BNE myLivesNotZero
;JMP RESET ;; game over.
;;;; also could warp to game over screen here instead.

WarpToScreen #$01, #$255, #$01 ;;This is warp to UNDERWORLD, LAST SCREEN this is for me because 8x8 , #$01 is normal warp;;

;; arg0 = warp to map. 0= map1. 1= map2.
;; arg1 = screen to warp to. use mouse to find coordinates = #$yx use hex convertor.
;; arg2 = screen transition type - most likely use 1 here.
;; 1 = warp, where it observes the warp in position for the player.
;;Don't Forget to set WARP IN COORDINATES ON YOUR MAP!;;

JMP +skipHurt

myLivesNotZero:

LDA continueMap
STA warpMap

LDA continueX
STA newX
LDA continueY
STA newY

LDA continueScreen
STA warpToScreen
STA camScreen

LDA myMaxHealth
STA myHealth



+skipHurt
 
Last edited:

dale_coop

Moderator
Staff member
Last screen, is 255 that is #255 or #$FF in hex (same value! just a different way to write it)
So, in your case, like it was in the example topic, it should be:
Code:
 WarpToScreen #$01, #255, #$01
Or:
Code:
 WarpToScreen #$01, #$FF, #$01
But not:
Code:
 WarpToScreen #$01, #$255, #$01

And make sure your Game Over screen is set correctly (the "warp in x,y coords"... and maybe place solid tiles all around the screen to avoid your player to leave that game over screen.
 

mouse spirit

Well-known member
Hey everyone!

So I've been messing with Nesmaker now for a little over a year. I have put it away for about 8 months do to being confused on somethings. Some are so simple. I've been back at it now for about 2 months and making progress. I seem to still have a hard time with some of the coding of Nesmaker. I know it would help if I could work with someone directly. I have a concept, levels, player animations ect.

Thinks i need help on...

Game over screen
Check points
Cut screens
Death screens
ect....

Ive watch alot of the tutorials and some seem to help other just are alittle bit out of my league. Ive ask for help on the form but sometime i think its to simple for anyone to reply. I feel bad but if im asking i just dont understand what im doing wrong. I sit and work on my project daily.
If there is anyone out there willing to take the time out to explain some of these things step by step a bit better that would be great. If payment for time is need im willing to do that for your help!
Im working with Metrovaina platform in nesmaker 4.5.9

Thank you for anyone for at least considering!!
This may help with simple understandings of 6502 asm.
I wrote these, they are simplistic compared to others and hopefully helpful.

 
Top Bottom