Git Product home page Git Product logo

booty5's Introduction

Hi there 👋

booty5's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

booty5's Issues

Standard HTML audio elements won't play

The following snippet does not work if using standard HTML audio (not using web audio and not using marmalade):-

var sound = new b5.Sound("explosion", "Explode.mp3", true );
sound.play();

Here is the fix:-

//Fixed version of sound play function
b5.Sound.prototype.play = function()
{
if (b5.app.use_web_audio)
{

    if (this.buffer === null)
        return null;
    var context = b5.Sound.context;
    var source = context.createBufferSource();
    var gain = context.createGain();
    source.buffer = this.buffer;
    source.loop = this.loop;
    source.connect(gain);
    gain.connect(context.destination);
    gain.gain.value = 1;
    source.start(0);
    if (this.auto_play)
        this.snd = { source: source, gain: gain };
    return { source: source, gain: gain };
}

var snd = null;
if (this.reuse)
    snd = this.snd;

if (snd === null)
{
    //fix
    this.load();
    snd = this.snd; 
    //fix
}
if (snd !== null) {
    snd.play();
}
return snd;

};

Does Booty5 supports image data processing?

I use Booty5 mostly in DroidScript, so i'm familiarized with the image methods of it.
So i want to know if Booty5 have any methods to adjust hue, saturation and brightness. Also copying drawn images from an actor. If not, can you add it?

Manual Error Page 32 of 173

"Whilst layers can be used to visually order the order in which visible scenes are overlaid, where layers are not used you can bring actors to the front of the visual stack or send them to the back using b5.Scene.bringToFront() and b5.Scene.sendToBack()."

you meant to say actor.bringToFront()/sendToBack().

Online API docs for addFixture describe 'points' not 'vertices' as option

The online API docs for actor.addFixture describe 'points' not 'vertices' as an option. The code expects 'vertices'

This works:-

//Ground actor.
var ground = new b5.PolygonActor();
ground.name = "polygon1";
ground.points = [-200,500, 200,500, 200,540, -200,540];
ground.fill_style = "green";
ground.filled = true;
scene.addActor( ground );

//Ground Physics.
ground.initBody( "static", false, false ); 
ground.addFixture( {type:b5.Shape.TypePolygon, vertices:ground.points} );

Booty5 Frozen on Windows 7 and not working over the local network

Hello Mat, I am using Booty5 in my teaching but my students keep getting Booty5 run error message below:

You cannot start application Booty5 from this location because it is already installed from a different location

How can someone resolve this issue?
Why is not possible to run Booty5 at any time?
Does it write to registry or user folder on Windows?
Can it be run standalone non install on Windows for student uses?

Please help!

God blesses!!!

Best regards,
Sanyaade

app.onResize is constently being triggered even when no resizing is going on resulting in double vision for sprites sometimes.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Booty 5</title>

<style type="text/css">
body
{
	background-color: #666;
	width: 1024px;
	height: 576px;
}
</style>

<script src="booty5_min.js"></script>

<script>
window.addEventListener("load", on_init);

function on_init(event)
{
	window.removeEventListener("load", on_init);

	//Initialize Booty5
	var app = new b5.App(document.getElementById("Booty5_Canvas"), true);
	b5.app = app;
	app.debug = true;
	app.target_frame_rate = 24;
	app.setCanvasScalingMethod(b5.App.FitBest);

	//Scene Stuff:
	var scene = new b5.Scene();
	scene.name = "main scene";
	app.addScene(scene);
	app.onResize = function()
	{
		trace ("Why is this constantly being triggered ?");
	}

	app.waitForResources();

	var actor = new b5.ArcActor();
	actor.fill_style = "rgb(80,20,255)";
	actor.radius = 30;
	actor.x = actor.y = 1;
	actor.vx = 1;
	scene.addActor(actor);
}

function trace(arg)
{
	console.log(arg);
}
</script>
</head>
<body>
<canvas id="Booty5_Canvas"></canvas>
</body>
</html>

Sometimes when you resize the browser, you will see "double vision" for the circle sprite...and also...is x = 0 suppose to be at the center instead of the top left which is the standard for Flash ?

How come app.addScene(scene)/app.removeScene(scene) but no app.destroyScene(scene)

Documentation says: It has scene.destroy(); but it's a little inconsistent not to have app.destroyScene(scene) or even better that and app.removeAndDestroyScene(scene).

Because if you don't do that, it leads to many internal questions/unknowns.
Do you have to remove the scene via app.removeScene and then scene.destroy later ? [This is syntaxtually not very beautiful.]

And what happen when you call scene.destroy without first calling app.removeScene ?
Does it holds a null bug waiting to happen then since it still technically holds a scene that is no longer there ?

All these could be eliminated if app.destroyScene(scene) and app.removeAndDestroyScene(scene) is implemented.

Please correct me if I am wrong thank you because I am learning and trying to make everything consistent in my mind :-)

Another case in point, you have:
scene.addResource(material, "Material");
scene.findResource("static_bounce", "Material");
scene.destroyResource("static_bounce", "Material"); //or material.destroy(); if you already have access to the material directly.

So for consistency sake, you have app.addScene, app.findScene but scene.destroy() but no app.destroyScene() is consistently wise a little strange I think.

ReferenceError: FBInstant is not defined

7 May 2020:
This is as barebone as it gets, I just load it, haven't even do anything with it yet and firefox give me that error :-(

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Booty 5</title>
<script src="booty5_min.js"></script>
<script>
window.addEventListener("load", on_init);

function on_init(event)
{
	window.removeEventListener("load", on_init);
	trace ("Hello !");
}

function trace(arg)
{
	console.log(arg);
}
</script>
</head>
<body>

</body>
</html>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.