I need a programmer.

StarBlades

Active member
Hi! I want to make my game where after 30 in game days, a text box pops up saying "your time is up, peasant." and then return to the title screen. anyone? This IS for byte off 2020! I would also like the display of days to be shown in the hud. and what is a good Day/Night cycle speed?
 

mouse spirit

Well-known member
If the day night cycle is active in 4.5 , use it.
Or We could easily say tick a variable every time you enter a screen.
When you say, walk to 10 screens, that variable,now 10, ticks a new variable.

warning,not actual code
Code:
So when Daytimevar = 10 ;;;you have walked 10 screens
Newdayvar = 1 ;;;now it is the next day,day 2
Reset Daytimevar ;;;reset the 10 screen time
If Newdayvar = 30 , create textbox , If not,move on
Loop;;;do it all again

This variable could be shown in the hud also.
 

mouse spirit

Well-known member
Heres a link to alot of helpful 4.1.5 links also, https://nesmaker.fandom.com/wiki/Help_with_....?venotify=created
Mostly platform stuff, but some isnt.
 

StarBlades

Active member
what i mean is the day/night cycle is active. Day 0 gets changed to day 1 once the cycle is finished and it is day again.
 

mouse spirit

Well-known member
Yeah, i feared that may have been true. Dont worry starblades, we will figure it out or keep this game on your backlog maybe.
 

StarBlades

Active member
I need to make a script/ code where every 15 screens you walk across, a day progresses. I also need it to be displayed on the hud.
 

crazygrouptrio

Active member
StarBlades said:
I need to make a script/ code where every 15 screens you walk across, a day progresses. I also need it to be displayed on the hud.

What I would do is implement two user variables, like "screenCount" and "timeOfDay" or something (name doesn't matter obviously). In each of your bounds handler scripts near the bottom you would add:
Code:
LDA screenCount
CMP #16
BEQ +
AddValue #$02, screenCount, #$01, #$00
JMP doneCountingScreens
+
LDA #$00
STA screenCount
LDA timeOfDay
CMP #$01
BEQ +
LDA #$01
STA timeOfDay
JMP doneCountingScreens
+
LDA #$00
STA timeOfDay
JMP doneCountingScreens
doneCountingScreens:
That may not work as-is (it's off the top of my head :? ) You also may run into issues counting above the number 10, and 09 might be a better number to go with. But basically that code will add 1 to the variable screenCount, but when it hits 16 it instead changes timeOfDay to 1 and resets screenCount to 0, starting the count over. Then if timeOfDay is 1 it changes it to 0 instead. You would then need to come up with your day and night cycle that would vary based on the timeOfDay variable (0 being day, 1 being night). If you already have your own day and night system you could stick it in there instead of the timeOfDay stuff. Good luck!
 
Top Bottom