Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

duderbrolomando35

6
Posts
3
Topics
A member registered Dec 26, 2015

Recent community posts

class ScriptBehavior extends Sup.Behavior

{

Test1 : Sup.Actor;

awake()

{

let MainCameraMan = new Sup.Actor("CamMain1");

//MainCameraMan.camera = new Sup.Camera(MainCameraMan);

// MainCameraMan.setPosition(0, 0, 0);

new Sup.Camera(MainCameraMan);

MainCameraMan.setPosition(0, 0, 0);

this.Test1 = new Sup.Actor("Derp");

this.Test1.setPosition(0, 0, 0);

new Sup.SpriteRenderer(this.Test1, "GameSprites/background1");

//Derp.spriteRenderer.setSprite("GameSprites/background1");

}

update()

{

}

}

Sup.registerBehavior(ScriptBehavior);



this is in a file script, and its added to a Empty actor in my start up scene (which is set to load on start), it gives me no errors and loads the screen as a BLACK object. The debugger is hard to figure out so I cant understand if something is spawning like it should or not. (unlike cosntruct 2 which is easy to see all entties in scene), anyway, Im just wondering WHAT am i doing wrong if it throws no errors? (again, this behavior has been added to an actor that is saved to the scene itself, no default camera tho, I wanted to instantiate one.) my only guess is, like in perhaps other javascript style use, I created the camera but did not append it to the scene, so its only stored as a variable and not in the scene yet?? thats weird.. doubt it cuz this engine is different?

(1 edit)

I checked the index.js

var statusElt = document.querySelector(".status");
var tempFolderPath;
var qs = querystring.parse(window.location.search.slice(1));
var buildPath = (qs.project != null) ? "/builds/" + qs.project + "/" + qs.build + "/" : "./";
function start() {
  if (!isApp) {
  statusElt.textContent = "Can't run in browser";
  document.querySelector(".must-use-app").hidden = false;
  return;
}
document.body.addEventListener("click", function (event) {
  if (event.target.tagName !== "A")
    return;
  event.preventDefault();
  electron.shell.openExternal(event.target.href);
});
if (localStorage["supLove2DPath"] == null || !fs.existsSync(localStorage["supLove2DPath"])) {
  document.querySelector(".where-is-love").hidden = false;
  document.querySelector(".where-is-love button").addEventListener("click", onLocateLoveClick);
}
else
  downloadGame();
}

i cant figure it out, also my game that is exported gets stuck in a infinite (Downloading Game) loop and doesnt launch... very odd. anyway thanks for this again, just hope to understand this more. It will take me more time to understand base supGame with typescript. meanwhile i plan to use Lua.

i figured it out :

http://docs.superpowers-html5.com/en/getting-start...

it applies to the same thing so follow this first and then that one

http://docs.superpowers-html5.com/en/development/b...


it helps to see the folder structute of the one the Superpowers dev team use to make it easy and wallah you too are now capable

anyway good work dev team thanks again for this open source project.

I followed this : http://docs.sparklinlabs.com/en/development/buildi...

and figured it out and it took some doing but now I want to have a stand alone folder like how you distribute your own (as im using lua) and wish to understand how to do this?


Running the app with Electron

  1. Open a terminal and install Electron by running npm install -g electron-prebuilt
  2. Go in the right folder with cd superpowers/launcher
  3. Start the launcher with electron .


I did this and it is nice, but to keep doing it is kind of annoying. But it would be nice to figure out how. unless we cant. then i understand. But anyway thank you!

open source is nice, if i make some games i'll release some source too.

Ok, if I'm understanding this right, to get a behavior it must be printed to superpowers log using Sup.Log(<value retrieved somewhere stored>) which can be an actor so Sup.log(<ActiorName>.getBehavior(<BehaviorName>).<VariableName>); and lets say I wanted to run update tests against this value or another value (like its position overlapping a damaging tile) I would run positional checks in code against the Superpowers Actor class (Sup.Actor which I created as "Test1" for instance) and then in a if conditional


if Sup.log(Sup.log(actor.getBehavior(MyCustomBehavior).CustomX) == Sup.log(Sup.log(EnemyActor?.getBehavior(MyCustomBehavior).CustomX) // Can the engine differentiate collisions and run these functions from each object?

{

let tempVar = Sup.log(actor.getBehavior(MyCustomBehavior).health);

actor.getBehavior().<custom_method>(param0, etc);


//Define method here>>>>>>???


//Or is the method a script that is loaded before this is run or after?

}


sorry for the newbie questions, Ive been learning programming but working with pre-built engine environments is just as confusing to me sometimes but is usually far less work which is why I am trying to learn to use everything I can. For instance game maker/unity work alot like this but still sometime confuses me.

hey i was trying this out and i had a question, how do you type or include member variables to the Sup,Actor class?


Such as let healthvar = 100; and somehow access with the

let ActorGuy = new Sup.Actor("Test1")


and giving it that variable and accessing it later with stuff like Test1.healthvar += 1; (in some behavior script in an update function somewhere)


im very confused, also not sure where the main help thread for this software is.... im not used to typescript but trying to learn and I read how you declare objects in ECMA5 or whatever and it said you do

object = {

key: this,

key: that,

key: donelastkeyhere


}


and youd reference them within that way, but im not 100% sure. I'm trying to build a game just using code and C++ is giving me pains so i switched to typescript to see how it'd work and it seems to be similar in pain but without the awful linker issues.