• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
  • entries
    104
  • comments
    101
  • views
    252573

A C64 Game - Step 97

Sign in to follow this  
Followers 0
Endurion

1400 views

And here's a little gameplay update, the bats. The diagonal movement was too predictable, so now there's more randomness to it.

step97.png

The bat will move in curves. On every end of a curve the new direction will be decided randomly. Two tables are enough, however due to the C64 using two bit complement negative values are annoying to handle. Therefor I went the naive route and simply added code for every case. Ugly, but it works smile.png;------------------------------------------------------------;simply move diagonal;------------------------------------------------------------!zone BehaviourBatDiagonalBehaviourBatDiagonal jsr HandleHitBack beq .NoHitBack rts.RandomDir jsr GenerateRandomNumber and #$07 sta SPRITE_DIRECTION,x inc SPRITE_DIRECTION,x lda #0 sta SPRITE_MOVE_POS,x rts.NoHitBack lda DELAYED_GENERIC_COUNTER and #$03 bne .NoAnimUpdate inc SPRITE_ANIM_POS,x lda SPRITE_ANIM_POS,x and #$03 sta SPRITE_ANIM_POS,x tay lda BAT_ANIMATION,y sta SPRITE_POINTER_BASE,x .NoAnimUpdate lda SPRITE_DIRECTION,x beq .RandomDir cmp #1 beq .MoveCCWWN cmp #2 beq .MoveCCWSW cmp #3 beq .MoveCCWES cmp #4 beq .MoveCCWNE cmp #5 bne + jmp .MoveCWWS+ cmp #6 bne + jmp .MoveCWNW+ cmp #7 bne + jmp .MoveCWEN+ cmp #8 bne + jmp .MoveCWSE+ .NextStep inc SPRITE_MOVE_POS,x lda SPRITE_MOVE_POS,x cmp #16 bne + lda #0 sta SPRITE_DIRECTION,x sta SPRITE_MOVE_POS,x+ rts .MoveCCWWN ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveUp ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveRight jmp .NextStep.MoveCCWSW ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveLeft ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveUp jmp .NextStep.MoveCCWES ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveDown ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveLeft jmp .NextStep.MoveCCWNE ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveRight ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveDown jmp .NextStep.MoveCWWS ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveDown ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveRight jmp .NextStep.MoveCWNW ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveLeft ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveDown jmp .NextStep.MoveCWEN ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveUp ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveLeft jmp .NextStep.MoveCWSE ldy SPRITE_MOVE_POS,x lda PATH_CURVE,y sta PARAM3 jsr .TryMoveRight ldy SPRITE_MOVE_POS,x lda PATH_CURVE_R,y sta PARAM3 jsr .TryMoveUp jmp .NextStep.Blocked lda #0 sta SPRITE_DIRECTION,x rts.TryMoveUp beq + jsr ObjectMoveUpBlocking beq .Blocked dec PARAM3 jmp .TryMoveUp + rts .TryMoveDown beq + jsr ObjectMoveDownBlocking beq .Blocked dec PARAM3 jmp .TryMoveDown + rts .TryMoveLeft beq + jsr ObjectMoveLeftBlocking beq .Blocked dec PARAM3 jmp .TryMoveLeft + rts .TryMoveRight beq + jsr ObjectMoveRightBlocking beq .Blocked dec PARAM3 jmp .TryMoveRight + rts

The table are simple delta updates per frame, one being the reverse of the other:PATH_CURVE !byte 0 !byte 0 !byte 1 !byte 0 !byte 0 !byte 1 !byte 0 !byte 1 !byte 0 !byte 1 !byte 1 !byte 1 !byte 1 !byte 1 !byte 1 !byte 1PATH_CURVE_R !byte 1 !byte 1 !byte 1 !byte 1 !byte 1 !byte 1 !byte 1 !byte 0 !byte 1 !byte 0 !byte 1 !byte 0 !byte 0 !byte 1 !byte 0 !byte 0

The other thing is a little fix for a bug I found with the vanishing bats for the last portal stages. The bats could appear outside the playing area. The fix are two border values for left and right which will be set to be farther inside the screen if a portal level is run: ;set default lda #10 sta SPAWN_LEFT_BORDER lda #30 sta SPAWN_RIGHT_BORDER ;adjust spawn border on portal level lda LEVEL_CONFIG and #$04 beq + lda #15 sta SPAWN_LEFT_BORDER lda #25 sta SPAWN_RIGHT_BORDER+

...and adjust the spawn code inside BehaviourBatVanishing: ;position diagonal above/below player lda SPRITE_CHAR_POS_X cmp #SPAWN_LEFT_BORDER ;was #10 bcc .SpawnOnRight cmp #SPAWN_RIGHT_BORDER ;was #30 bcs .SpawnOnLeft


Previous Step Next Step

0
Sign in to follow this  
Followers 0


2 Comments


Doesn't the 6502 just use the same two's complement used in pretty much all modern CPUs? (some specialized DSPs being the only modern exception) I don't see what's so weird about it, in fact the whole point is that they can be treated the same as unsigned numbers for a lot of operations.

0

Share this comment


Link to comment

Yeah it does, but having only the MSB set as a negative flag would make working with it easier. At least for that particular use :)

 

You could use BPL or BMI to check the flag and if BMI would be branched simply AND #$7f the value to have the result.

 

Two's complement is however really nice to simply "add" negative values.

0

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now