It is currently Tue Oct 24, 2017 4:42 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Nov 25, 2014 4:38 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2295
I have a problem. I need to be able to perform character actions in both directions (left and right) so I'm using a direction flag to decide either to add or subtract velocity to an object position. The problem I have is when the player kicks a boss, in order to fall in the correct direction, it has to EOR direction flags and negate velocity if they're facing opposite directions. Anybody know of a way to fix this problem?


Top
 Profile  
 
PostPosted: Tue Nov 25, 2014 4:56 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19122
Location: NE Indiana, USA (NTSC)
Could you be a bit more specific about what you're asking?

You need a direction flag to store which direction a player is facing even if standing still.

If you have to "EOR direction flags and negate velocity", then "EOR direction flags and negate velocity". You'll probably need to special case whether the player and enemy are facing same or opposite directions anyway so that you can animate the enemy properly whether kicked from the front or the back.

Negating a number can be done inline:
Code:
  eor #$FF
  sec
  adc #$00

This is in fact a special case of reverse subtraction:
Code:
; A := amount - A
  eor #$FF
  sec
  adc amount


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group