Another new wip Ninja Run
-
-
Nice wall jump!
-
Awesome. I see you've used your lovely custom UI overlay too - very nice. This is going to be such a cool project!!
-
Very good indeed mate, looks great!
-
@Dave I'm a Big fan of the Ninja Gaiden games hoping to at least capture some of that magic, id say most of my time getting the game to that stage was messing with old button states they drive me mad hahah got there in the end:)
-
@waldron Well you certainly do capture some of that magic here without a doubt.
In terms of the old button states - is there anything I can help with? Any particular troubles?
-
@Dave i think my main issue was getting the dagger throw numbers working iv ended up doing (daggernum -= 0.3) instead of (daggernum -=1) because when you press the button to trigger it the number shoots down. hence my dodgy workaround.
-
@waldron I think this will help. I use this in every single one of my programs, whether or not I even plan to use it right away, because it always ends up being useful.
I see examples of people using their own structures to store the old button states - this is unnecessary, you simply need to store the whole controls struct.
Start with these two as global variables:
c = controls(0) oldc = c
Then in your main loop:
loop clear() c = controls(0) // read the new state of the controls and store it into the c variable before you do any control checking // game stuff oldc = c // right before you end your loop, store the state of the controls for that frame into the oldc variable update() repeat
With this set up, you can just do this:
if c.a and !oldc.a then // throw dagger daggernum -= 1 endif
The if statement reads: If the A button is pressed, AND it was NOT being pressed on the previous frame, then...
This means your daggernum variable will only ever decrease by 1 per A button press.
-
@Dave iv tried that i may have some code in the wrong place or something upsetting it maybe or possibly dodgy controller il retest later and see what happens i even tried a false true switch so could be a dodgy button fortunately i do have some new ones ordered
-
@waldron The important part is to make sure that you abide by that structure:
loop c = controls(0) // any and all controller checking MUST be between these two lines. oldc = c repeat
Feel free to share the program with me privately if you have trouble figuring out the problem.
-
@Dave yeah i think i haven't put the code in the correct place after rereading through the message :) i should be able to solve it, iv been using a different method for my last couple of projects which has probably tripped me up thanks man
-
@waldron No worries dude. Always here for help if you need!
-
-
This is looking (ha, and sounding!) really good.
-
@Jonboy ha yeah if link can get away with it rolling across hyrule field why not :)
-
Been a while since i'v updated on the forum for this game
Started adding enemies only adding one type as i'm wanting to flesh out the levels with traps and obstacles.
so far the enemy only has an idle state and can be killed with sword or dagger but will be adding to it with invisible boxes one to detect the player which will trigger an attack counter and another to detect its map surroundings hopefully ;) one thing i'v learnt during my coding journey ... your constantly learning -
Your skillz know no bounds!
-
Hello,
This look good :)I wanted to share this bit of code with one of my game but I have no time to do it and need to work more on it before release.
It's a function to print bitmap font. You may already have one that do it but if it can save some times or give some ideas to you or other people it will be worth it:
I will modify it in my code so it will use sprites and drawSprite instead but this one may work for you as it// Load BM font texture var BM_FONT_IMG = loadImage("The Oliver Twins/DizzyFont6") // print definition function printText(fontHandle, x, y, text) var xOffset = 0 for i = 0 to len(text) loop var chrValue = chrVal(text[i]) - 32 drawSheet(fontHandle, chrValue, xOffset, y, 1.0) xOffset += tileSize(fontHandle, chrValue).x repeat return void // usage loop clear() printText(BM_FONT_IMG, 32, 32, "Hello World!") update() repeat
If it help at least 1 user I will be super happy.
-
@romain337 thanks, i was using a similar function for custom font but since swapped it for another due to random string errors.
i'l try this out thankyou :) i would suggest putting this function into a program and share it as it would help many users! -
@romain337 Well prepare to smile because this helped me with a future project. Thanks for sharing!