RE: RPGame

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanks for looking into it.  I did catch the change of the destination 
and source bitmaps.  What appears to be odd is this:


code

r_angle = itofix(0)

killit = 0

while killit = 0 do

  if key(KEY_ESC) then
	killit = 1
  end if

  if key(KEY_RIGHT) then
	r_angle += itofix(8) 
	if r_angle > itofix(256) then 	
		r_angle -= itofix(256) 
	end if  
		
	blit(rocketimage, rocketmod, 0, 0, 0, 0, 40, 40)      
                                -- clean up 
	rotate_sprite(rocketmod, rocketimage, 0, 0, r_angle)  
                    -- do new rotate only if angle has changed
	
		rest(200)  -- to show the individual keypresses
  elsif key(KEY_LEFT) then
	r_angle -= itofix(8) 
	if r_angle < itofix(0) then 
		r_angle += itofix(256) 
	end if
		
	blit(rocketimage, rocketmod, 0, 0, 0, 0, 40, 40)
	rotate_sprite(rocketmod, rocketimage, 0, 0, r_angle)
		
		
	rest(200)
  end if

  textout(buffer, fontptr, sprintf("azi: %d", {fixtoi(r_angle)}), 40,    
450, 250)
  blit(rocketmod, buffer, 0, 0, 200, 200, 40, 40)

  vsync()
	
  blit(buffer, screen_ptr, 0, 0, 0, 0, 640, 480)

  rest(1)
end while
 

I seem to get very erratic behavior from rotate_sprite().  That is, it 
doesnt seem to follow a linear path and rotate_sprite seems to actually 
rotate the image by an arbitrary amount regardless of the what I feed 
r_angle.  I checked with the allegro guys and they don't believe its a 
bug in Allegro, looking at the euall source I can't seem to find a 
reason for the wrapper to be broke either.

Anyways, thanks for taking a look.  Any thoughts?


Steve A.


Lewis Townsend wrote:
> 
> 
> posted by: Lewis Townsend <keroltarr at hotmail.com>
> 
> For Steve,
> 
> I just started playing with rotate_sprite() in Euallegro.
> It appears that like several other routines in Euallegro, the 
> documentation is incorrect. The source and dest images are switched.
> It could be that this error is in the source code also. (I didn't check)
> 
> Ray's euAllegro.txt:
> ------------------------<rotate_sprite>------------------------------
> Syntax:}}}
<eucode>
>    rotate_sprite(aSourceBmp, aDestBmp, iX, iY, aAngle) </eucode>
{{{

> 
> My correction:
> ------------------------<rotate_sprite>------------------------------
> Syntax:}}}
<eucode>
>    rotate_sprite(aDestBmp, aSourceBmp, iX, iY, aAngle) </eucode>
{{{

> 
> 
> Let me know if this wasn't your problem.
> I'll post an example program if you would like.
> 
> later,
> ======
> Lewy T
>
> http://rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=Townsend
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu