• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Anubiss

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Anubiss

  • Rank
    Member

Personal Information

  • Location
    Holtsee/Kiel in Germany
  1. hey guys. following problem: I want to let my startbutton shake if it is not touched within 10 seconds. this lecture is out of a book i baught for starting with Android programing. But although i am thinking of havin done everything correct, the button does not shake. [b]buttonID = button1[/b] [b]res/anim/wackeln.xml[/b] [code] <?xml version="1.0" encoding="utf-8"?> <alpha xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="-40" android:toDegrees="40" android:duration="1000" android:repeatCount="20" /> [/code] and in my main activity: [code] private Animation animationWackeln; private Button startButton; private Handler handler = new Handler(); public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button) findViewById(R.id.button1); button.setOnClickListener(this); animationWackeln = AnimationUtils.loadAnimation(this, R.anim.wackeln); startButton = (Button)findViewById(R.id.button1); } private class WackleButton implements Runnable { public void run() { startButton.startAnimation(animationWackeln); } } @Override protected void onResume(){ super.onResume(); handler.postDelayed(new WackleButton(), 1000*10); } [/code] i hope someone will help. thank you
  2. what do you mean with that i "dont take keypad input in my menu loop"? they´re in each loop as i see. in the first Menu it´s even working, but if i´m pressing the A-Button the new menu appears but with each klick on up or down the "o" will put out on each y-value EDIT: Allright, I understood what you mean. made it now so: [code]//Handelsbildschirm: ///////////////////////////////////////////////// void handelsbildschirm(void){ PA_OutputText(1,0,1,"++++++++++++++++"); PA_OutputText(1,0,2," Station: %02d", stations[istationen].id); PA_OutputText(1,0,3,"++++++++++++++++"); PA_OutputText(1,2,5,"Handelsbildschirm"); PA_OutputText(1,0,6,"++++++++++++++++"); PA_OutputText(1,0,optionskursor,"o"); if(Pad.Newpress.Down)optionskursor++; if(Pad.Newpress.Up)optionskursor--; } //Stations-Menü: ///////////////////////////////////////////////// void stationsmenu(void){ PA_OutputText(1,0,1,"++++++++++++++++"); PA_OutputText(1,0,2," Station: %02d", stations[istationen].id); PA_OutputText(1,0,3,"++++++++++++++++"); PA_OutputText(1,2,5,"Handelsbildschirm"); PA_OutputText(1,2,6,"Stationsinformationen"); PA_OutputText(1,2,7,"Schiffsinformationen"); PA_OutputText(1,0,optionskursor,"o"); if(Pad.Newpress.Down)optionskursor++; if(Pad.Newpress.Up)optionskursor--; }[/code] and to call the menu: [code] while ((stations[istationen].entfx<30)&&(stations[istationen].entfy<30)){ //PA_OutputText(1,2,9,"'X' zum kaufen"); // //menu(); if(optionsflag==0)stationsmenu(); if(Pad.Newpress.A)optionsflag=1; if(optionsflag==1)handelsbildschirm(); break; }[/code] I´m of course not ready with it, but seeing that it´s working, is bringing me forward. Have much thanks!
  3. But i only have to use free() if i really want to destroy an "object"? So i can create, create and create and only for "n"- 1 (for example) i need to free the memory then? EDIT: btw, there´s a new question i have. i made an option-menu [code]//Handelsbildschirm: ///////////////////////////////////////////////// void handelsbildschirm(void){ while(1){ PA_OutputText(1,0,1,"++++++++++++++++"); PA_OutputText(1,0,2," Station: %02d", stations[istationen].id); PA_OutputText(1,0,3,"++++++++++++++++"); PA_OutputText(1,2,5,"Handelsbildschirm"); PA_OutputText(1,0,6,"++++++++++++++++"); PA_OutputText(1,0,optionskursor,"o"); if(Pad.Newpress.Down)optionskursor++; if(Pad.Newpress.Up)optionskursor--; if(Pad.Newpress.B)break; } } //Stations-Menü: ///////////////////////////////////////////////// void stationsmenu(void){ PA_OutputText(1,0,1,"++++++++++++++++"); PA_OutputText(1,0,2," Station: %02d", stations[istationen].id); PA_OutputText(1,0,3,"++++++++++++++++"); PA_OutputText(1,2,5,"Handelsbildschirm"); PA_OutputText(1,2,6,"Stationsinformationen"); PA_OutputText(1,2,7,"Schiffsinformationen"); PA_OutputText(1,0,optionskursor,"o"); if(Pad.Newpress.Down)optionskursor++; if(Pad.Newpress.Up)optionskursor--; if(Pad.Newpress.A){ PA_ClearTextBg(1); switch(optionskursor){ case 5: handelsbildschirm(); } } }[/code] I choose with my cursor the option "Handelsbildschirm" an it leads me to the new menu, but there the cursor does not move. is it because of the "while()" ?
  4. glorious! have much thanks. it´s working very fine. but for understanding. realloc is reserving memory as malloc is doing. But realloc keeps the given values and new values are simply added behind the already excisting values?
  5. i´m calling it in each frame. should i make some kind of counter or something like that? but i don´t think it can be a lack of mem, because a few minutes ago i was able to load about 30 new stations, with 30 sprites. but they just where created on the same coordinates.. and didn´t move
  6. thank you. now i have one problem more. my function is now looking like that: [code]oid ladestationen(void){ stations = (ownstation*) malloc(n*sizeof(ownstation)); istationen=0; while (istationen<n){ if (stations[istationen].flag!=1){ stations[istationen].x=330; stations[istationen].y=120; PA_CreateSprite(0, istationen,(void*)station01_Sprite, OBJ_SIZE_64X64,1, 1, stations[istationen].x-16, stations[istationen].y-16); stations[istationen].flag=1; } PA_SetSpriteXY(0, istationen, ((stations[istationen].x-16)+(-scrollx>>8))-16, ((stations[istationen].y-16)+(scrolly>>8))-16); istationen++; } }[/code] It works everything so far, but when i create a new station the game freezes. it does not freeze, when it looks like so: [code]void ladestationen(void){ stations = (ownstation*) malloc(n*sizeof(ownstation)); while (istationen<n){ if (stations[istationen].flag!=1){ stations[istationen].x=330; stations[istationen].y=120; PA_CreateSprite(0, istationen,(void*)station01_Sprite, OBJ_SIZE_64X64,1, 1, stations[istationen].x-16, stations[istationen].y-16); stations[istationen].flag=1; } PA_SetSpriteXY(0, istationen, ((stations[istationen].x-16)+(-scrollx>>8))-16, ((stations[istationen].y-16)+(scrolly>>8))-16); istationen++; } }[/code] but now the x and y values of the station do not change..
  7. Alright. It´s working so far. I can add a new station. But after making one station the game freezes. [code] void ladestationen(void){ while (istationen<n){ stations[istationen].x=210; stations[istationen].y=100; if (stations[istationen].flag!=1){ PA_CreateSprite(0, istationen,(void*)station01_Sprite, OBJ_SIZE_64X64,1, 1, stations[istationen].x-16, stations[istationen].y-16); stations[istationen].flag=1; } PA_SetSpriteXY(0, 3, ((stations[istationen].x-16)+(-scrollx>>8))-16, ((stations[istationen].y-16)+(scrolly>>8))-16); } } [/code] I almost think, that this is correct. But following I wrote out of a function and out of the main-function: [code]ownstation* stations; stations = (ownstation*) malloc(n*sizeof(ownstation));[/code] And how does it work with resizing? I don´t really understand where exactly this has to be written. EDIT: That´s wrong, aye? void ladestationen(void){ stations = (ownstation*) malloc(n*sizeof(ownstation)); while (istationen<n){ stations[istationen].x=210; stations[istationen].y=100; if (stations[istationen].flag!=1){ PA_CreateSprite(0, istationen,(void*)station01_Sprite, OBJ_SIZE_64X64,1, 1, stations[istationen].x-16, stations[istationen].y-16); stations[istationen].flag=1; } PA_SetSpriteXY(0, 3, ((stations[istationen].x-16)+(-scrollx>>8))-16, ((stations[istationen].y-16)+(scrolly>>8))-16); } temp = (ownstation*) malloc(newlen*sizeof(ownstation)); memcpy(temp, stations, oldlen*sizeof(ownstation)); free(stations); stations=temp; }
  8. allright. the 1st part i checked. now i do following: [code] void menu(void){ if (Pad.Newpress.X) n++; } [/code] and [code] if ((rs.entfx<30)&&(rs.entfy<30)){ PA_OutputText(1,0,2,"'X' zum kaufen-"); menu(); } [/code] So i add "1" to n, when the X-Button is pressed. And how are the stations looking like? I mean, if n=2, do i have stations[0] and stations[1] then?
  9. this malloc function sounds very good, but it seems like i need to understand a bit more about this and also pointers. So i made now a struct for the stations i want to buy: [code] typedef struct{ int id; int x; int y; int flag; int entfx; int entfy; }ownstation; ownstation neu[10]; [/code] Is it correct to make an array now if i for example don´t want to have more than 10 stations? then i have found following for this malloc: [code] char * String; String = (char *) malloc(1000); [/code] so if the code would be: if (klicking on "buy"){ do what? } EDIT: ownstation* neu(neu[10](int id[10])); something like this maybe? (i know that it is not correct, but maybe i am on the right way)
  10. Hey friends. I hope you can help me with my lil game what i´m writing in C with the PaLib library for my nintendo ds. I have a ship what´s flying through the orbit. when the ship is landing in the space-station i want to have the option "buy new station". But how do i code the creation of a new station. i just need the idea of how doing that. Will be happy about any help. Here´s the code till now: [code] // Includes #include <PA9.h> #include "gfx/all_gfx.c" #include "gfx/all_gfx.h" int main(int argc, char ** argv) { PA_Init(); PA_InitVBL(); PA_EasyBgLoad(0, 1, aa); PA_InitText(1,0); PA_LoadSpritePal(0, 0, (void*)vaisseau_Pal); PA_LoadSpritePal(0, 1, (void*)station01_Pal); PA_CreateSprite(0, 0,(void*)vaisseau_Sprite, OBJ_SIZE_32X32,1, 0, 128-16, 96-16); // Das SChiff auf Mitte des unteren Screens setzen PA_SetSpriteRotEnable(0,0,0); u16 angle = 0; int x = (128) << 8; int y = (96) << 8; int sx; int sy; typedef struct{ int x; int xmax; int schalter; }pflanze; pflanze buche; buche.xmax=1000; buche.schalter=0; int scrollx = 0; int scrolly = 0; //Raumstation: ///////////////////////////////////////////////// typedef struct{ int x; int y; int flag; int entfx; int entfy; }station; station rs; //station fremd[10];//0-9 rs.x=200; rs.y=96; rs.flag=0; rs.entfx; rs.entfy; void station01test(void){ rs.entfx=(sx>>8)-(rs.x);//Entfernung zwischen Station und Raumschiff messen if (rs.entfx<0){rs.entfx=-rs.entfx;}//Betrag, falls Entfernung negativ! rs.entfy=(sy>>8)-(rs.y); if (rs.entfy<0){rs.entfy=-rs.entfy;} if (rs.flag==0){ PA_CreateSprite(0, 2,(void*)station01_Sprite, OBJ_SIZE_64X64,1, 1, rs.x-16, rs.y-16); rs.flag=1; } if ((rs.entfx>100)&&rs.flag==1){ PA_DeleteSprite (0, 2); rs.flag=0; } if ((rs.entfy>100)&&rs.flag==1){ PA_DeleteSprite (0, 2); rs.flag=0; } if ((rs.entfx<30)&&(rs.entfy<30)){ PA_OutputText(1,0,2,"'START' zum Landen-"); } if ((rs.entfx>30)||(rs.entfy>30)){ PA_OutputText(1,0,2," "); } } //Einfacher test: ///////////////////////////////////////////////// void wachse(void){ if (buche.schalter==1) if(buche.x<buche.xmax) buche.x++; if(buche.x==buche.xmax) buche.x=buche.xmax; } //STATUSBILDSCHIRM ////////////////////////////////////////////////////////////////// void statusscreen(void){ //Ausgabe von Informationen auf oberen Screen: //////////////////////////////////////////////////////////////////////////////// PA_OutputText(1,0,12,"Map-x: %02d", scrollx>>8); PA_OutputText(1,0,13,"Map-y: %02d", scrolly>>8); PA_OutputText(1,0,14,"-------------------"); PA_OutputText(1,0,15,"Schiff-x: %02d", sx>>8); PA_OutputText(1,0,16,"Schiff-y: %02d", sy>>8); PA_OutputText(1,0,17,"-------------------"); PA_OutputText(1,0,18,"x von Station entfernt: %02d", rs.entfx); PA_OutputText(1,0,19,"y von Station entfernt: %02d", rs.entfy); PA_OutputText(1,0,20,"Winkel des Schiffes: %02d", angle); } //MAIN: //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// while (1) { //Test-Buche: zählt von 0 bis 1000, wenn "A" gedrückt wird if (Pad.Newpress.A) buche.schalter=1; wachse(); PA_OutputText(1,0,0,"%02d", buche.x); //Winkelberechnung-Flugschiff: /////////////////////////////////////////////////////////////////////////////// angle = PA_GetAngle(x>>8, y>>8, Stylus.X, Stylus.Y); // PA_SetRotsetNoZoom(0, 0, angle); // Änderung des Schiffswinkels // //Flugschiff-Koordinaten AUSSERHALB DER ENGINE: sx=(scrollx+x); sy=(scrolly+y); //Hintergrund-Scrolling: ////////////////////////////////////////////////////////////////////////////// if(Pad.Held.B){ // scrollx += PA_Cos(angle); // scrolly += PA_Sin(angle); }; //Map-Grenzen: // if((scrollx>>8)>(2560-255)){ scrollx=590080; }; if((scrollx>>8)<0){ scrollx=0; }; if((-scrolly>>8)>(1600-191)){ scrolly=-360704; }; if((-scrolly>>8)<0){ scrolly=0; }; //Set-Map: PA_LargeScrollXY(0, 1, scrollx>>8, -scrolly>>8); statusscreen(); PA_SetSpriteXY(0, 0, (x>>8)-16, (y>>8)-16); PA_SetSpriteXY(0, 2, ((rs.x-16)+(-scrollx>>8))-16, ((rs.y-16)+(scrolly>>8))-16); station01test(); PA_WaitForVBL(); } return 0; } [/code]