Hello my pixelate friends

zero

New member
I'm ZERO from Brasil i love nes games and i collect some games from Nes and Famicom as you can see on image bellow
When i not playing i'm mobile programmer and now i discovered this awesome program NesMaker.

I watched almost all video tutorials and i found really cool scripts here so i decide to make a game. Also i'm studing some of Assembly and i made some codes :) For now i'm just learning some recourses to make a MetroidVania game, so i learned cool thins like:

Create Player
Create Monster
Manage Monster energy
Manage Player Shoot
Monster Drop item
DoubleJump
To Float
Monster Tile that is destroyed only if i kill the monster, in this case to make a Boss Room
Weapon Tile that is destroyed only with some weapons, like in Metroid to enter in some areas
To Get different Weapon Types

And now i'm trying to do a slide but is too difficult!!! I will ask for you help soon!

Thankyou!!!

1644924973976.jpg
 

dale_coop

Moderator
Staff member
Welcome ZERO
Glad you joined us.
NESmaker is really fun tool to start in nes dev. Don't hesitate to browse and search on the forum for piece of code, scripts, some fixes.
And feel free to share your projects
Can't wait to see what you will create with NESmaker

have fun!
 

LaffinJoker

New member
I’m interested in the double jump script as well as the special bullet that breaks certain blocks, keep us updated on how it’s going.
 

zero

New member
I’m interested in the double jump script as well as the special bullet that breaks certain blocks, keep us updated on how it’s going.
Hello @LaffinJoker ! I got the DoubleJump here => Double Jump
About special bullet that breaks certain blocks:

1 - Create a new Tile Type, like DoorTile
1645394404745.png

2 - Assign an Script to a same position as the new Tile. In this case "doorTile" is on 12 position so find the 12 script on TileTipes and load a Script like DoorTile.asm
1645394679640.png

3 - Get the tile code like below "0C"
1645395046493.png

4 - Script
How it works:
This tile is set to Solid so is aways checking for a specific weapon type collision, if true start to check all tiles untill find the DoorTile so the Tile is replaced by another Tile also its Type. The Script below replace the Tile to a BlankTile but its type is a Warp type.
;;solid tile

LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid


;check if colides with a weapon
LDA Object_type,x
CMP #$02 ;check if object is a Projectile in $02. If true so start to check all tiles utill find DoorTile to be destroyed
BEQ +destroyTile
JMP +weaponCantDestroy

+destroyTile
WEAPON_TILE = #$0C ; the number of your DoorTile.
LDX #$00
checkForDoorTiles
LDA currentNametable
AND #%00000001
BEQ +isEvenCt
LDA #$24
STA temp1 ;; high byte of thing
;;; is odd col table.
LDA collisionTable2,x
CMP #WEAPON_TILE
BEQ +IsDoorTile
JMP +notDoorTile
+IsDoorTile
;; is door tile.
LDA #$00
STA collisionTable2,x

JSR getTileToChange_afterColision

JMP +doneWithTileUpdate
+isEvenCt
LDA #$20
STA temp1 ;; high byte of thing.
;;; is odd col table.
LDA collisionTable,x
CMP #WEAPON_TILE
BEQ +IsDoorTile
JMP +notDoorTile
+IsDoorTile
;; is door tile.
LDA #$00
STA collisionTable,x
JSR getTileToChange_afterColision

JMP +doneWithTileUpdate

getTileToChange_afterColision:
TXA
STA temp
LSR
LSR
LSR
LSR
LSR
LSR
clc
ADC temp1
STA temp2
TXA
AND #%11110000
ASL
ASL
STA tempz
TXA
AND #%00001111
ASL
ORA tempz
STA temp3


;;; SET THE TILE NUMBER TO CHANGE TO.
LDA #$00 ;; the tile to change.
;;; this is in tiles, so if you wanted the second "metatile",
;;; use 2, not 1. If you wanted the tile in the next row,
;;; use #$20, not #$10. Etc.
STA tempA
CLC
ADC #$01
STA tempB
CLC
ADC #$0F
STA tempC
CLC
ADC #$01
STA tempD


LDY #$00
LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
STA scrollUpdateRam,y
INY
LDA tempA
STA scrollUpdateRam,y
INY

LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
CLC
ADC #$01
STA scrollUpdateRam,y
INY
LDA tempB
STA scrollUpdateRam,y
INY

LDA temp3
CLC
ADC #$20
STA temp3
LDA temp2
ADC #$00
STA temp2

LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
STA scrollUpdateRam,y
INY
LDA tempC
STA scrollUpdateRam,y
INY

LDA temp2
STA scrollUpdateRam,y
INY
LDA temp3
CLC
ADC #$01
STA scrollUpdateRam,y
INY
LDA tempD
STA scrollUpdateRam,y
INY

TYA
STA maxScrollOffsetCounter




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Turn on update screen on next frame.
LDA updateScreenData
ORA #%0000100 ;=> This is the tile type to set. In ths case i set Warp type
STA updateScreenData
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
TriggerScreen screenType
RTS
+doneWithTileUpdate


JSR doWaitFrame
+notDoorTile
INX
CPX #240
BEQ +weaponCantDestroy ;; done
JMP checkForDoorTiles ;; last door tile.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+weaponCantDestroy
rts
 

LaffinJoker

New member
Hello @LaffinJoker ! I got the DoubleJump here => Double Jump
About special bullet that breaks certain blocks:

1 - Create a new Tile Type, like DoorTile
View attachment 5970

2 - Assign an Script to a same position as the new Tile. In this case "doorTile" is on 12 position so find the 12 script on TileTipes and load a Script like DoorTile.asm
View attachment 5971

3 - Get the tile code like below "0C"
View attachment 5972

4 - Script
How it works:
This tile is set to Solid so is aways checking for a specific weapon type collision, if true start to check all tiles untill find the DoorTile so the Tile is replaced by another Tile also its Type. The Script below replace the Tile to a BlankTile but its type is a Warp type.
That’s awesome, thanks. I definitely need this.
 

Parkfun

New member
;If your breakable Tile is #10 and you want to use your melee weapon to destroy it, you can do this to change the tile to 00.
;I'm new to NESmaker, this works for my code, but if it has potential for any issues, let me know.

;; BreakableTile10 (Tile10)
;;solid tile - so player can't walk through it
LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid Tile

LDA Object_type,x ;See if Player weapon hit this tile
CMP #$01 ;Player weapon from "Game Objects" Player(00), Melee/Bullet(01), PowerUpBullet(02), etc.
BEQ +isPlayerWeapon
JMP +notPlayerWeapon ;; jump to subroutine label +notPlayer ;;
+isPlayerWeapon: ;; This is what happens if it is a player object collision. ;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BELOW WILL CHANGE TILE AT COLLISION. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ChangeTileAtCollision #$00, #$00 ;; this macro changes the tile to null collision, tile changes to look like location 00. ;;
; PlaySound #sfx_LivesPickup ;;uncomment for sfx to be activated on pickup ;;

+notPlayerWeapon:
rts
 

dale_coop

Moderator
Staff member
You answer a question that was asked more than a year ago!?
I am pretty sure the person has already found his answer (I hope so for him) ;)
 
Top Bottom