Special screens.

dale_coop

Moderator
Staff member
About your issue of stucked on the win screen... Don't know what to check... It should work.

Are you sure the script you assigned to the Win Screen is working? What is that script? StartGame? A custom one?
Again, are you sure your Win Screen has a music assigned (not "NO CHANGE" and not "NO MUSIC")?
Could share screenshots of the Win Screen editor?
 

dale_coop

Moderator
Staff member
The sprite has nothing to do... it's just a graphic glitch (might be your Handle PreDraw script)
 

dale_coop

Moderator
Staff member
Or maybe the issue is coming from your Handle PreDraw script? Have you made any modification in that script?
Could you share it? (copy / paste the content of the script between the < /> code tags... to have the tag buttons, first, you'll have to click on the "Full Editor & Review" button)
 

axbakk

Member
i dont know what script thats handle that screen. have not edited somting there. i have just designed the win screen (special screens) and assigned press start - reset to it. The pre setting WIN GAME jumps to that screen by default. That part works. Its just when my player is game over (all lifes gone) that the win screen gets frozen.it have no change if i have music or not on the screen, the win screen when you get to the win flag ingame works with the setting STOP_SOUND.

Hope you find somting odd here so this nut can be cracked.. :)

Here is my PlayerLoseLife script right now:

Code:
;;; do loss of life stuff here
	DEC myLives
	LDA myLives
	BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	;JMP RESET
	
	;; go the win screen ?:
	LDA #STATE_WIN_GAME
	STA change_state
	LDA #$01
	STA newScreen
	JSR DeactivateAllObjects
	RTS	
	
gameNotOver:

	;;;;;
	;;; do warp to continue screen stuff here.
	LDA #$00
	STA newGameState
	LDA continueMap
	clc
	ADC #$01
	STA temp
	GoToScreen continueScreen, temp, #$04
	LDA #$00
	STA playerToSpawn
	; LDX player1_object
	; DeactivateCurrentObject
	LDA #$01
	STA loadObjectFlag

	LDA continuePositionX
	STA newX
	LDA continuePositionY
	STA newY

	;; player1 reset health:
	LDA #$03		;;  <--- HERE reset with your Health value
	STA myHealth


And here is the PreDrawn script:

Code:
;; sprite pre-draw
;;; this will allow a user to draw sprites
;;; before object sprites are drawn.
;;; keep in mind, there are still only 64 sprites
;;; that can be drawn on a screen, 
;;; and still only 8 per scan line!

;;; you can use DrawSprite macro directly using the following scheme:
;DrawSprite arg0, arg1, arg2, arg3, arg4
	;arg0 = x
	;arg1 = y
	;arg2 = chr table value
	;arg3 = attribute data
	;arg3 = starting ram position
	
;; x and y are the direct positions on the screen in pixels.
;; chr table value is which sprite you'd like to draw from the ppu table.
;; attribute data is a binary number (starts with #%), and here are how the bits work:
	;;; bit 7 - Flip sprite vertically
	;;; bit 6 - Flip sprite horizontally
	;;; bit 5 - priority (0 in front of background, 1 behind background)
	;;; bit 4,3,2 - (null)
	;;; bit 1,0 - subpalette used (00, 01, 10, 11)
	
	
;;; for starting ram position, use spriteOffset.
;; this is set to 0 just before entering this script (or 4 if sprite 0 hit was used).
;; ***remember to increase spriteOffset by 4 for every sprite that is drawn,
;; including after the last one drawn*****, so that the first object's sprite begins
;; in the next available spot.

;; I have created a macro function to handle updating to the next sprite.  So, to update to the next sprite position,
;; all that you have to do is use the function UpdateSpritePointer

;;EXAMPLE:
; DrawSprite #$80, #$80, #$10, #%00000000, spriteOffset
; UpdateSpritePointer

;;;; DRAW SPRITE ZERO FOR SPRITE ZERO HIT
	LDA gameState
	CMP #GS_MainGame	
	BNE + ;dont draw sprite zero
	;DrawSprite #$f8, #$1e, #$7F, #%00000000, spriteOffset
				;248   30    127   bit 5 = priority
	DrawSprite #SPRITE_ZERO_X, #SPRITE_ZERO_Y, #SPRITE_ZERO_INDEX, #%00100000, spriteOffset
	UpdateSpritePointer
;dont draw sprite zero.
+

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



	
;;=================== Platform engine
;; In our platform engine, the player can shoot from a 'projectile source'.
;; Since this projectile source does not interact with the background in any way,
;; it is really just a sprite extention of the player, and would be truly foolish to waste
;; an object and processing time on it.  You can, but it would be wasteful.
;; So what we can do instead is use pre-drawn sprites.  If the player is in his attack state,
;; we will check the direction, and then draw the weapon sprite based on which direction he is
;; facing.

	;LDX player1_object ;; we are going to check some player 1 things.
	;;; but getting current action type will set x to this automatically
	
	GetCurrentActionType player1_object ;; what object is the current player
										;; because if it's attack (3), we should draw weapon.
	CMP #$03
	BNE notAttackingSoDontDrawWeapon
	;;attacking, so draw weapon.
	LDA Object_movement,x
	AND #%00000111
	TAY ;; now y contains direction, so we can figure out position offset
	;CMP #RIGHT
	;BNE directionIsNotRightForDrawingWeapon
	;;; direction is right.
	 LDA Object_x_hi,x
     ;;; offset x for creation
     CLC
     ADC weaponOffsetTableX,y
	 SEC
	 SBC xScroll
     SEC 
     SBC #$08 ;; width of gun 
     STA temp
     LDA Object_y_hi,x
     CLC
     ADC weaponOffsetTableY,y
     sec
     sbc #$08 ;; height of gun
     STA temp1
	 
	 CPY #RIGHT
	 BNE directionIsNotRightForDrawingWeapon
	 ;; it is right, which means draw without flip
	 LDA #%00000001
	 STA temp2
	 JMP doDrawWeapon
directionIsNotRightForDrawingWeapon:
	LDA #%01000001
	STA temp2
doDrawWeapon:
	 
	DrawSprite temp, temp1, #SPR_WEAPON, temp2, spriteOffset
	 JMP doneDrawingWeaponSprite
	
	



doneDrawingWeaponSprite:
	UpdateSpritePointer
	
notAttackingSoDontDrawWeapon:
 

axbakk

Member
Screenshot of win screen in Nesmaker editor
 

Attachments

  • 504FA0D9-C178-4F4D-A683-F112C5191659.jpeg
    504FA0D9-C178-4F4D-A683-F112C5191659.jpeg
    240.1 KB · Views: 1,073
  • 12CF7461-2DC6-405B-9194-892C30825F6E.jpeg
    12CF7461-2DC6-405B-9194-892C30825F6E.jpeg
    314.5 KB · Views: 1,073

dale_coop

Moderator
Staff member
I am pretty sure that is your "STOP MUSIC" that freezes your game. As I wrote, I think you need to set a music (a song) to that WIN screen.
 

dale_coop

Moderator
Staff member
Ok... could you share a copy of your NESmaker folder (zipped and shared via dropbox or googleDrive or WeTransfer or send.firefox. com or ...) ? II could take check everything and tell you where is the issue and how to fix it.
 

axbakk

Member
Sure thing. When i get home from work. ๐Ÿ˜Š

Otherwise i could just make an screen like my pre-levelscreen (255) and put a level clear flag instead of an win game flag on my last level. Make the player warp to that screen and have Another invisible monster to reset the game after a timer.. not sure how to make that script for player lose all lives thou.. ๐Ÿค”


But Yeah i can send you the project later on.. ๐Ÿ˜Š๐Ÿ‘๐Ÿป
 

dale_coop

Moderator
Staff member
Yeah, it would be another possibility... (like in the "gameover" screen topic).
But your current WIN screen should work (it works on my demo project).
 

dale_coop

Moderator
Staff member
I checked your project :) Thx
Here, what I found...

For your "stuck" issue on the WIN screen, it's your reset script that is not correct (the "SimpleReset" one).
Just keep the "JMP RESET" line... remove (all comment out) all the other lines.

2019-10-24-23-23-55-NES-MAKER-4-1-5-Version-0x159-pinky-MST.png



Also, for your small sprite glitch at top left on the WIN Screen... as I suspected it's your Handle Pre-Draw script.
So modify the script assigned to the "Handle Sprite Pre-Draw" script, and add:
Code:
	JMP notAttackingSoDontDrawWeapon
around line 64 (because you don't need the code after that line... cause in your game you're not using the sprite based weapon).

2019-10-24-23-24-44-NES-MAKER-4-1-5-Version-0x159-pinky-MST.png
 

axbakk

Member
Big thanx Dale. The game runs like it suppose to now. :D
The Pinky Demo is ready.. :cool:
Then it will be more issues to solve as the project runs forward.. :lol:
 

axbakk

Member
:lol: Noticed when we were playing the demo that the player can shoot during pre-screens.. and the shot is visual on screen. :lol:
Anything that can be removed? :D
 

dale_coop

Moderator
Staff member
you could add a small code on the shooting script, to prevent the code from execute if on a cutscene screen:
Code:
	LDA screenType
	CMP #$FF ;; #255
	BNE +
	RTS
	+
 
Top Bottom