R0J0hound's Recent Forum Activity

  • With the 99.9 release you now can access private variables from python.

  • Cool new build.

    Figured out how to use the ribbon object, very nice.

    http://dl.dropbox.com/u/5426011/examples/ribbonExample.cap

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well, I tried my hand at it and found it to be somewhat tricky. I was able to do #1 and #3, but not #2. For that I personally would have to make my own platformer movement with events (would be less hacky).

    Here it is:http://dl.dropbox.com/u/5426011/examples/stairsExample.cap

    The events are not really much simpler, but the in editor setup is easier.

    -cheers

  • It seems to only be able add an attribute. When you try to remove one it does nothing.

  • Here's an example of context menus using the box and text objects.

    download: http://dl.dropbox.com/u/5426011/examples/contextmenu.cap

    As for a button menu:

    http://dl.dropbox.com/u/5426011/examples/contexttoolbar.cap

  • All the controls objects position themselves in relation to the window, not the layout. Also they are unaffected by zooming or scrolling. This is because they are drawn by the Windows GUI not by DirectX. A solution for your problem would be to calculate the window position of the sprite:

    -> ListBox: Set position to (Sprite.X-ScrollXLeft)*ZoomX/100, (Sprite.Y-ScrollYTop)*ZoomY/100[/code:y08gwiz9]
  • Here's a fixed cap:

    http://dl.dropbox.com/u/5426011/fixed/fovfixed.cap

    Only one block was showing because the player had the solid attribute so any other block could not be seen through the player. The block was off center because the mask size was incorrect.

    The mask size should be this:

    Width: 1024/32 = 32

    Height: 768/32 = 24

    With the different size i also adjusted the numbers in the events.

    I removed the colmap sprite as it was not needed the existing TiledBackground2 object did fine.

    -cheers

  • Here's an example FOV engine with walls that bock vision. Also it uses the imagemanipulator object so less resources are used than using the canvas object.

    http://www.scirra.com/forum/viewtopic.php?f=16&t=6679&start=0

  • Here is an example of a field of view engine using the image manipulator. I just used over sized pixels for the example but it is easy enough to use sprites instead. The advantage of using the image manipulator as opposed to a canvas is a very small amount of memory is used (a 20x30 pixel image for a 640x960 pixel layout with 32 pixel tiles).

    Enjoy

  • Here is a python script for ease in and out camera motion.

    class myscroll:
    	def __init__(self):
    		self.acceleration=100;		
    		self._ax=0;	self._ay=0
    		self._vx=0;	self._vy=0
    
    	def __call__(self, obj):
    		myscrollx=(System.ScrollXLeft+System.ScrollXRight)/2
    		myscrolly=(System.ScrollYTop+System.ScrollYBottom)/2
    
    		# x motion
    		diff=obj.X-myscrollx
    		if abs(diff)<1:
    			self._ax=0;  self._vx=0
    		else:
    			if self._vx**2/(2*self.acceleration) >= abs(diff):
    				self._ax=-1*cmp(self._vx,0)*self.acceleration
    			else:
    				self._ax=cmp(diff,0)*self.acceleration
    
    		# y motion
    		diff=obj.Y-myscrolly
    		if abs(diff)<1:
    			self._ay=0;  self._vy=0
    		else:
    			if self._vy**2/(2*self.acceleration) >= abs(diff):
    				self._ay=-1*cmp(self._vy,0)*self.acceleration
    			else:
    				self._ay=cmp(diff,0)*self.acceleration
    
    		self._vx+=self._ax*System.TimeDelta
    		self._vy+=self._ay*System.TimeDelta
    		System.ScrollX(myscrollx+self._vx*System.TimeDelta)
    		System.ScrollY(myscrolly+self._vy*System.TimeDelta)
    myscroll=myscroll()[/code:2fwplqvv]
    No need to understand how it works, just have that script run at the "start of layout" and call "myscroll(Sprite)" every tick.  The only setting is acceleration, which can be changed at any time with the script "myscroll.acceleration=400".
    
    Basically what it does is accelerate the camera to the object and then decelerate so that when the screen arrives at the object the camera speed will be zero.
    
    Example of use: [url]http://dl.dropbox.com/u/5426011/examples/camera%20easeinandout.cap[/url]
    req at least 0.99.84
    
    Feel free to use or enhance.
  • A solution for the jitter would be to stop the motion and point to the target when the angle difference and angular velocity are lower than some thresholds.

    Add this event to the "targeting" group:

    + System: AngleDiff(turret.Angle, turret ('target')) Lower than 0.5
    + System: abs(turret[Physics].AngularVelocity) Lower than 0.2
    -> turret: Set torque 0
    -> turret: Set angular velocity to 0
    -> turret: Set angle to 'target'[/code:1pqycuqz]
  • Finally got an example for a physics turret working:

    http://dl.dropbox.com/u/5426011/examples/PhysicsTurret.cap

    and tweaked so it works with multiple turrets:

    http://dl.dropbox.com/u/5426011/examples/multiPhysicsTurret.cap

    The only drawback is the turret's inertia needs to be calculated (which I do in the first second). Also the calculated inertia is not 100% accurate so the turrets jitter a bit when pointing at the target.

    -enjoy

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound