Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Just bought CopperCube - a question about the camera

karmacomposer
Registered User
Quote
2012-03-16 18:14:30

I am so happy I just bought CC 3 light - now to get started.

Question (and I think this was asked before), I noticed the fps camera requires a mouse click to use and it seems the arrow keys are not fluid - it feels like it moves a little bit per press.

(1) How can we make the mousemove work like almost all games - you move the mouse and the virtual head (camera) moves with it in all directions (no mouse click needed - since I would want to trap the mouse clicks for other purposes, like shooting and picking stuff up)?

(2) How can we make the keyboard keys move more fluidly - and how can we change them (say we want W, A, S, D or something like that instead of the arrow keys)?

(3) Can users change key preferences in game?

Thanks in advance.

Mike


erik
Registered User
Quote
2012-03-16 20:08:17

For the mouse: There is an option in the behavior, something like 'move when mouse down' or similar, check that. It doesn't work exactly as in those games then, but as close as possible in WebGL/Flash.
Keyboard keys are not changeable, AFAIK.


karmacomposer
Registered User
Quote
2012-03-16 22:59:31

You were right about the camera - works great.

The WASD keys are actually already set to work along with the ARROW keys, but I would love to know if and how we can map keys for other thing.

Time to read the manual.

Mike


karmacomposer
Registered User
Quote
2012-03-16 23:02:26

That wasn't hard. Right from the online manual:

function keyPressedDown(keyCode)
{
if (keyCode == 88)
{
// the user pressed the key 'X', move the 'cubeMesh1' scene node a bit up
var cube = ccbGetSceneNodeFromName("cubeMesh1");
var pos3d = ccbGetSceneNodeProperty(cube, "Position");

pos3d.y += 2;

ccbSetSceneNodeProperty(cube, "Position", pos3d);
}
}

So, just build a custom menu somehow and then program key mapping with javascript.

I assume you can create menus in CopperCube so you can adjust music volume, sound volume, etc.

How about resolution? Can that be configured?

Back to the manual.

Mike


karmacomposer
Registered User
Quote
2012-03-16 23:29:18

No where in the documentation does it talk about creating HUDs and MENUs. Can anyone expound on how to do this.

Mike


niko
Moderator
Quote
2012-03-17 06:45:13

Resolution cannot be configured at runtime (unless you are using Flash or WebGL), I'm sorry. :/
There are usual two ways to use HUDs: Either use the 2D Overlay feature from the editor, it comes with support of displaying single line text and images, as well as absolute or proportional (=resolution independent) sizing. Or alternatively, draw the HUD yourself:

- In the Windows.exe or Mac OS X .app target using the draw..() functions from the API
- In WebGL either using a HTML overlay (explained in the 2D Overlay tutorial) or using the draw...() functions of the renderer.
- In Flash by embedding the created .swf in your own .swf, and creating whatever you want on top of that.


karmacomposer
Registered User
Quote
2012-03-19 03:30:06

Can we create driving games in CopperCube?

Flight games?

Mike


cyril
Registered User
Quote
2012-03-19 11:06:12

You can make all you wish but you must know how to program. Pre-existent gameplay in Coppercube are limited...(but very interessant for the use of the engine)


Chris
Guest
Quote
2023-07-16 15:12:00

Hi Niko,
does this happen automatically or is there a snippet available on how to change it via runtime in WebGL? Thank you
wrote:
Resolution cannot be configured at runtime (unless you are using Flash or WebGL), ...



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact